tag:blogger.com,1999:blog-47696298150009751222024-03-13T20:59:22.854-07:00Barts pc + Android tutorialstutorials for pc and android usersBoris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-4769629815000975122.post-77761250799678867892017-03-05T11:41:00.000-08:002017-03-12T05:17:53.112-07:00Kodi ubuntu / linux: autoplay mp3 on USB using udev<b>Kodi ubuntu / linux autoplay hot-pluggable devices like USB, using udev:</b><br />
<br />
<b>Ideal for building custom music players </b><br />
<br />
Run:<br />
sudo apt-get install kodi-eventclients-kodi-send <b><br /></b><br />
<br />
<br />
<b>#-------------------------------------------- </b><br />
#/etc/udev/udev.rules.d/9999-usb-play.rules<br />
#Code:<br />
<br />
ACTION=="add", KERNELS=="usb*", SUBSYSTEMS=="usb," DRIVERS=="usb", \<br />
RUN+="/usr/bin/systemd-run /storage/autoplay.sh /dev/%k"<br />
<br />
<br />
---------------------------------------<br />
<br />
<br />
<br />
#!/bin/bash<br />
#/storage/autoplay.sh chmod +x /storage/autoplay.sh<br />
sleep 10<br />
<br />
MP=$(grep "^${1} " /proc/self/mounts | cut -d ' ' -f 2)<br />
<br />
shopt -s globstar<br />
shopt -s nullglob<br />
if [! -f ${MP}/pl.m3u ]<br />
then <br />
for f in ${MP}/*.mp3 ${MP}/**/*.mp3 ${MP}/**/**/*.mp3 ;<br />
do <br />
if [[ $f != *"*.mp3"* ]];<br />
then echo "$f" >> "${MP}/pl.m3u" ; fi ; done ;<br />
fi ;<br />
/usr/bin/kodi-send --action="PlayMedia(\"${MP}/pl.m3u\") <br />
<br />Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-75647421926567649432016-02-21T08:37:00.003-08:002016-02-23T03:44:07.033-08:00Kodi web interface: Favorite ShortcutsFor some reason i needed to link buttons to play the next and previous favorite, using the Web Interface with Kodi.<br />
<br />
How it works:<br />
Copy the default web interface from the global kodi addons folder to your user addon folders, modify addon.xml.<br />
<br />
Modify index.html,<br />
add to the body tag onload="favid=0;" just to be sure that javascript won't cry.<br />
<br />
make some div or span onclick="favid=gotofav(favurl,favid+1);"<br />
<br />
or any favorite ID you wish :-)<br />
<br />
or do it in jQuery if you desire so, i currently can't be bothered researching howto.<br />
<br />
<br />
Modify xbmc.launcher.js to include a new js file with this contents:<br />
<blockquote class="tr_bq">
favurl='jsonrpc?request={"jsonrpc":"2.0", "method":"Favourites.GetFavourites", "params": { "properties": ["window","path","thumbnail","windowparameter"] }, "id": 1 }';<br />favid=0;<br />function gotofav(favurl){<br /><br />$.getJSON(favurl, function( data ) {<br /> var items = [];<br /> <br /> $.each( data, function( ke, va ) {<br /> $.each( va, function( key, vall ) {<br /> <br /> if (key=='favourites'){<br /><br />if (favid < 1){<br /> <br /> favid=vall.length;<br />}<br /><br />//}<br /><br />if (favid >vall.length){ favid=0;} <br /><br /> $.each( vall, function( keyz, valz ) {<br /><br /><br /> if (favid==keyz){<br /> <br /> if (valz['type'] == 'media'){<br /> <br /> xbmc.rpc.request({<br /> 'context': this,<br /> 'method': 'Player.Open',<br /> 'id': '1',<br /> 'params': {<br /> <br /> 'item': {<br /> 'file': valz['path']<br /> }<br /> }});<br /><br /> }<br /> if (valz['type'] == 'window'){<br /> xbmc.rpc.request({<br /> 'context': this,<br /> 'method': 'GUI.ActivateWindow',<br /> 'id': '1',<br /> 'params': {<br /> <br /> "window": "videos",<br /> "parameters": [valz['windowparameter']]<br /> <br /> }});<br /> }<br /> if (valz['type'] == 'script'){<br /> //alert(valz.toSource());<br /> xbmc.rpc.request({<br /> 'context': this,<br /> 'method': 'Addons.ExecuteAddon',<br /> "wait": false,<br /> 'id': '1', <br /> 'params': {<br /> <br /> <br /> 'addonid': valz['path']<br /> <br /> }<br /> });<br /><br /> }<br /> <br /> }<br /> <br /> <br /> // }<br /> <br /> <br /> <br /> });<br /> <br /> <br /> <br /> <br /> }<br /> <br /> <br /> });<br /> <br /> });<br /> <br /><br /> });<br /> return favid;<br /> <br /> <br />}<br /></blockquote>
<br /><br /><br />
It's not as pretty as can be, but it works great :-).<br />
<br />Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-48420515661728454872015-03-17T08:50:00.000-07:002016-01-05T22:24:25.118-08:00Teddy woofpaw Wordpress Installer android app<h2>
<b>Installing wordpress on your webhost has never been so easy, as with Teddy Woofpaw wordpress installer.</b></h2>
<u><b>Step1:</b></u><br />
Download, Install & start the wordpress installer app on your android device. (search google play for teddy wordpress installer).<br />
<br />
<u><b>Step2: </b></u><br />
Input the credentials provided by your webhost: Domain name, ftp hostname, ftp user, ftp password & click install.<br />
<br />
<br />
<u><b>Step 3:</b></u> <br />
Enter the mysql user and password, <br />
<br />
<br />
<u><b>Done! Wordpress is up and running!</b></u><br />
<u><b><br /></b></u>
<u><b>Step 4:</b></u><br />
<br />
<a href="https://play.google.com/store/apps/details?id=org.wordpress.android&hl=nl_NL"></a><a href="https://play.google.com/store/apps/details?id=org.wordpress.android&hl=nl_NL" target="_blank">Official wordpress app </a>can now be installed and used to connect to your site.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKL5eJOTYEDN82id954t9AetapTlMGPLvgGvAd5AK7OtA-ZuI49RxhNpzZ76KHCSBoI4A8M-43js9UhrMb3oC3NuPTnhXoaWfvkKnKkbxwZENL_MITyeCXkp4cWiByfo1JzFJS_GhTrKei/s1600/functional.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKL5eJOTYEDN82id954t9AetapTlMGPLvgGvAd5AK7OtA-ZuI49RxhNpzZ76KHCSBoI4A8M-43js9UhrMb3oC3NuPTnhXoaWfvkKnKkbxwZENL_MITyeCXkp4cWiByfo1JzFJS_GhTrKei/s1600/functional.png" width="320" /></a></div>
<br />
<br />
<br />
<br />
<br />
Current limitation:<br />
will always be installed to the domain root.<br />
<br />
<br />
<b>Encountering a problem?</b><br />
Determining the correct folder for the ftp uploads is done simply by trying to open certain folders in the right order.<br />
<br />
The order in which the app tries to enter folders is this:<br />
<br />
domains \ _usersupplieddomain_ \ html \ htdocs \ public_html \ www \ wwwroot<br />
<br />
This ensures support for all modern webhosts.<br />
Please let me know if your webhost uses an incompatible folder layout on the ftpserver, and provide me a screenshot (via <a href="http://bartbosma.eu/" target="_blank">email</a> (click the keyboard) or here in the comment section), i'd be happy to update the app.<br />
<br />
<br />
<b>Geek talk; Technical explanation of how the app works</b><br />
When the user submits the data, the app connects with the ftp. <br />
In slow mode (max compatible), next: the app uploads http://wordpress.org/latest.zip.<br />
Then, the app uploads an<a href="http://barts-tutorials.blogspot.com/2015/03/wordpress-installer-php-script.html"> php script</a> (click to see it).<br />
After uploading is complete, the app opens a webview, visits the url to the php script.<br />
In fast mode, the php script downloads http://wordpress.org/latest.zip.<br />
The php script unzips the wordpress zip file and puts everything in place.<br />
The php script deletes itself, and sends the webview in the app user to the wordpress first-run script with a header redirect.<br />
<br />
<br />Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-41588381781374860182015-03-16T05:48:00.001-07:002015-03-18T03:43:30.511-07:00Wordpress installer PHP scriptExample PHP script for installing wordpress in the root of your domain.<br />
This exact script is used in my new upcoming android app <a href="https://play.google.com/store/apps/details?id=bbappz.wordpressinstaller" target="_blank">Wordpress Installer</a>.<br />
You can save it in a file, upload it to your host and run it in your browser.<br />
It will download Wordpress, unzip the wordpress archive, launch the wordpress first-run script, afterwards this script will delete itself.<br />
the $wpextr variable can be changed to install into a subfolder. Use a leading and a trailing slash.<br />
<span style="background-color: #fff2cc;"></span><br />
<span style="background-color: #fff2cc;"><span style="background-color: #fff2cc;"></span><br /></span>
<span style="background-color: #fff2cc;"><?php<br /><br />// www.bartbosma.eu<br />// 2015<br />@ob_start();<br />function rrmdir($dir) {<br /> if (is_dir($dir)) {<br /> $objects = scandir($dir);<br /> foreach ($objects as $object) {<br /> if ($object != "." && $object != "..") {<br /> if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);<br /> }<br /> }<br /> reset($objects);<br /> rmdir($dir);<br /> }<br />} <br />$wpextr="/wp/";<br />$wpextr="/";<br />$url = "https://wordpress.org/latest.zip";<br />$destination = "wordpress_latest.zip"; <br />if (!file_exists($destination)){<br /> <br /> if (function_exists("curl_init")){ <br /> $fp = fopen ($destination, 'w+');<br /> $ch = curl_init();<br /> curl_setopt( $ch, CURLOPT_URL, $url );<br /> curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1" );<br /> curl_setopt( $ch, CURLOPT_BINARYTRANSFER, true );<br /> curl_setopt( $ch, CURLOPT_RETURNTRANSFER, false );<br /> curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );<br /> curl_setopt( $ch, CURLOPT_AUTOREFERER, true );<br /><br /> curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 100 );<br /> curl_setopt( $ch, CURLOPT_FILE, $fp );<br /> curl_exec( $ch );<br /> curl_close( $ch );<br /> fclose( $fp );<br />}else{<br /> if (!file_put_contents($destination, fopen($url, "r"))){<br /> $succes=false;<br /> die("Cant download file.."); <br /> }<br /> <br />}<br />if (filesize($destination) > 0) {$succes= true;echo "Archive download succes.<br />";}else{$succes=false;}<br /><br /><br />}else{<br /> echo "Archive already exists, no download required<br />";<br />$succes=true;} <br /><br /><br />if ($succes==true)<br />{<br />$zip = new ZipArchive;<br />if ($zip->open($destination) === TRUE) {<br /> #echo $_SERVER['DOCUMENT_ROOT'].$wpextr;<br /> $zip->extractTo($_SERVER['DOCUMENT_ROOT'].$wpextr);<br /> $zip->close();<br /> echo 'Archive extracted succes';<br /> sleep(1);<br /><br />if ($handle = opendir($_SERVER['DOCUMENT_ROOT'].$wpextr.'wordpress')) {<br /> while (false !== ($fileName = readdir($handle))) {<br />
if ($fileName!==".." ||$fileName!==".")
@rename($_SERVER['DOCUMENT_ROOT'].$wpextr."wordpress/".$fileName,
$_SERVER['DOCUMENT_ROOT'].$wpextr.$fileName);<br /> }<br /> closedir($handle);<br /> <br /><br />@unlink("wpinst.php");<br />sleep(1);<br />rrmdir($_SERVER['DOCUMENT_ROOT'].$wpextr.'wordpress');<br />header("Location: http://".$_SERVER['HTTP_HOST'].$wpextr."/wp-admin/install.php");<br /><br />}<br /> <br /> <br />} else {<br /> echo 'ExtractTo function: Opening the wordpress zip file failed. Your webhost seems ancient.';<br />} <br /> <br />}<br />// www.bartbosma.eu xD<br />?></span>Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-63088005379757489002015-03-09T10:28:00.001-07:002015-03-09T16:32:23.427-07:00Android HTPC TVMC hdmistick ultimate guide tutorialSo, you stumbled upon those android HDMI sticks, and now you wonder
how to set it up for epic HTPC usage, and what software to use.<br />
<br />
I'll explain what i did.<br />
<br />
First i bought the hardware.<br />
I bought:<br />
Rikomagic 802 version 3.<br />
This version has some small wifi bugs, requiring a hard reboot occasionally, with a minute pauze after powerdown.<br />
<br />
I added:<br />
externally powered USB hub with support for all different types of SD cards (brand Icidu).<br />
External USB blu-ray player.<br />
External USB HDD for MP3/photos.<br />
Instead of powering the HDMI stick with the TV it's USB slot, i decided to use an old USB DC adapter (from some phone).<br />
<br />
<br />
Setting up the software to interact together nicely, requires some proper effort, but nothing too fancy.<br />
Controlling the device can be done with a keyboard that includes multimedia keys like play / stop / back.<br />
Using the TAB button and the windows keys, you have enough to set up the device for remote control.<br />
<br />
The first remote control app you (not mandatory) need on both your HDMI stick as your android phone, is RemoDroid:<br />
<a href="https://play.google.com/store/apps/details?id=de.im.RemoDroid">https://play.google.com/store/apps/details?id=de.im.RemoDroid</a><br />
Determining
the IP address to connect to, on the HDMI device, simply goto wifi
settings and click your wifi network. Your IP should popup.<br />
Now,
unfortunately remodroid is kinda slow, so if you want to, like, play
games on your hdmi stick, there are some specialist stores selling nice
USB/bluetooth remote control devices, tailored for Android specifically.<br />
<br />
<br />
Next, installing TVMC is the easiest way to go:<br />
<a href="http://www.tvaddons.ag/tvmc-android/">http://www.tvaddons.ag/tvmc-android/</a><br />
It comes with all the nice plugins preconfigured.<br />
Icefilms and NavX are my recommendations.<br />
<br />
Ofcourse
there are tons of repositorys with nice plugins, ill list the most
common, you can set these up as file sources in TVMC; system > file
manager > add source:<br />
<br />
<i>http://srp.nu </i><br />
<a href="https://superrepo.org/"><cite class="_Rm">https://superrepo.org/</cite></a><br />
<cite class="_Rm"><br /></cite>
<cite class="_Rm">i.totalxbmc.tv</cite><br />
<a href="http://www.totalxbmc.tv/"><cite>http://www.totalxbmc.tv/</cite></a><br />
<cite><br /></cite>
<i>http://xunitytalk.com/xfinity/</i> <br />
<i><a href="http://www.xunitytalk.com/">http://www.xunitytalk.com/</a></i><br />
<br />
Good,
now you could
basically watch any tv show/movie, have subtitles in your preferred
language (in TVMC goto addons and install subtitle addon).<br />
<br />
TVMC
on android has some minor hardware-keyboard bugs. Backspace won't work,
delete key (also multimedia back key) acts like backspace instead.<br />
But who cares, since we will remote control the device with the official XBMC remote app: <br />
<a href="https://play.google.com/store/apps/details?id=org.xbmc.android.remote">https://play.google.com/store/apps/details?id=org.xbmc.android.remote</a><br />
(which became outdated, search for KODI instead in the play store for alternatives)<br />
<br />
Or if you are exrtemely special, you can use an Apple phone:<br />
<a href="https://itunes.apple.com/nl/app/official-xbmc-remote/id520480364?mt=8">https://itunes.apple.com/nl/app/official-xbmc-remote/id520480364?mt=8</a><br />
However
i strongly suggest that Apple users also buy an Apple HDMI stick. They
are very rare, but keep looking and maybe one day you might find one.<br />
<br />
Before this TVMC remote control app works, you need to goto settings in TVMC and enable the remote control setting.<br />
<br />
If you are dutch, you could also install the xot-uzg plugin:<br />
<a href="http://www.rieter.net/">http://www.rieter.net/</a><br />
<br />
Installing
SambaDroid APP allows you to manage / sync your external USB hard drive
its MP3 database with your linux/windows workstation, which you
probably use to collect MP3 files:<br />
<a href="https://play.google.com/store/apps/details?id=berserker.android.apps.sambadroid&hl=nl">https://play.google.com/store/apps/details?id=berserker.android.apps.sambadroid&hl=nl</a><br />
<br />
There are some andoid apps which allow one to collect mp3 files aswell, like goSeek: <br />
<a href="https://play.google.com/store/apps/details?id=org.thylakoid.goseek">https://play.google.com/store/apps/details?id=org.thylakoid.goseek</a><br />
<br />
an
example sync from workstation to miniHTPC script for use in windows:
(you can create a .bat file with this text in it, or open an terminal
via start-search "cmd":)<br />
<br />
robocopy "E:\My Music\sort" \\SAMBADROID\usb\USB_disk0\OneTouch4\user\mp3 /R:1 /MIR /Z /DCOPY:T /FFT<br />
<br />
Syncing from the device to your windows workstation, use the same command, but just name the local folder last.<br />
<br />
Sometimes
the drive ID will change depending on your hdmistick, you can just add
multiple commands with multiple drive ids like DISK3 etc<br />
Ofcourse a local NAS drive is much prefered.<br />
<br />
<br />
There is just one problem now.<br />
You need to turn on your TV before you can play music from your HTPC device.<br />
Fixing this requires one more investment.<br />
It's
unfortunately a device not often used thus not for sale at most stores,
search engines or ebay will pick it up when you search for stuff like
HDMI to HDMI + audio extractor.<br />
One brand that i know of is DeLOCK, searching delock HDMI extractor should give you results.<br />
<u>DON'T buy an USB soundcard. it WON'T work.</u><br />
<br />
Perhaps you want TVMC to launch automatically whenever you turn on the device, simply get an app like autostart: <br />
<a href="https://play.google.com/store/apps/details?id=com.autostart">https://play.google.com/store/apps/details?id=com.autostart</a>Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-17403638541575491052015-03-09T09:56:00.002-07:002015-03-09T10:03:41.940-07:00MAMCWES, The most secure mysqli php class wrapper i've ever seen.This post is all about...... mamcwes (<a href="http://bartbosma.eu/mysqli_class_for_php/LICENSE.TXT" target="_blank">GPL v3</a>)
<br />
<h3>
What's that?</h3>
Easy to use PHP class for MySQL interaction, optionally allowing linking
between multiple database user logins (with custom user rights on your
databases/tables) and custom userlevels.
<br />
<h3>
For who is it?</h3>
PHP writers / developers / coders generally.
<br />
<h3>
What does it do, how does it differ from other mysqli classes?</h3>
Its an mysqli wrapper providing extensive security protection.<br />
Basically, the required credentials for the mysqli connection are loaded only very briefly into the php memory, inside the class call. It is fully impossible for people to get the mysql login credentials.<br />
<br />
Furtermore, it allows you to login as multiple mysql users based on your custom userlevel table, useful for hard-restricting permissions to the database, providing even more security.<br />
<h3>
How does it work?</h3>
$this->gl_conf_ulvl in the mysqlcfgdata.inc.php is the userlevel setting. Default it loads from $_SESSION['rdmstring'].<br />
One should use the escstr function to parse any kind of user input. <br />
Looking at the class (functions) name(s), it won't be too hard figuring out how to make the DB connection / calls.<br />
<hr />
<b>Usage example:</b><br />
First add your database connection login to the cfg file.
<code>
<span style="background-color: #fff2cc;">@session_start();<br />
$_SESSION['rdmstring']="us0rlv0l";<br />
$_SESSION['us0rlv0l']=1; # userlevel, optionally set by your own login
script. will be used to select login data (array) id from config file.</span></code><br />
<code><span style="background-color: #fff2cc;"></span></code><br />
<code><span style="background-color: #fff2cc;"></span></code><br />
<code><span style="background-color: #fff2cc;"></span></code><br />
<br />
#<code><span style="background-color: #fff2cc;"><span style="background-color: #fff2cc;">For more protection you could use:<br />
</span><code><span style="background-color: #fff2cc;">#$_SESSION['rdmstring']="md5(time());";</span></code></span></code><br />
<code><span style="background-color: #fff2cc;"><code><span style="background-color: #fff2cc;">#$_SESSION[${$_SESSION['rdmstring']}]=1;</span></code> # userlevel</span></code><br />
<code><span style="background-color: #fff2cc;"><br /></span></code>
<code><span style="background-color: #fff2cc;">$mysqlerrordie=0;# 1 to terminate php execution on mysql error.<br />
#$olddir=getcwd(); #optional<br />
#chdir("classes");<br />
include "mysql.class.5.php"; # note: when you put the class in another
folder, use chdir("classes"); first to navigate to that folder. go back
with chdir($olddir); if needed.<br />
#chdir($olddir);<br />
</span></code><br />
<span style="background-color: #fff2cc;"><code>
$sql=@new MYSQL();<br />
$r=$sql->query("<br />
SELECT badword<br />
FROM `badwords` WHERE `badword` = '".$sql->escstr(customvalidatefunction($_POST['badword']))."'"<br />
");<br />
<br />
if (isset($r) && $sql->count_rows($r) > 0){<br />
foreach($sql->db_array2($r) as $item){ #also available are db_array,
db_object(2) and db_assoc(2), whereas the 2 means more then 1 entry can
be fetched, thus requiring processing via foreach loop.<br />
print_r($item);<br />
echo $item[0];<br />
}<br />
</code></span><br />
<span style="background-color: #fff2cc;">
</span><code><span style="background-color: #fff2cc;"></span><br /><br />Basically, if you build your own userlogin system with this class, you first connect with a readonly mysql user that retrieves your user table, retrieves the userlevel of the logged in person, and than you can use that userlevel variable to select the desired mysql user credentials (permissions) for that userlevel, while the userlevel will always be stored in a random Session variable.<br />Untracable and ultrasecure.<br />
</code>
<br />
<h3>
Download</h3>
<a href="http://code.google.com/p/mysqliclass-mamcwes/downloads/list">mamcwes 0.2 (English)</a>Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-14633425519935473932014-01-13T15:32:00.001-08:002014-01-14T05:08:01.587-08:00Using Android in your car, full guideHey,<br />
<br />
So today, i'd like to write about utilising your android tablet/phone in your car.<br />
<br />
<br />
What could one possibly want?<br />
<br />
<ul>
<li>(Offline) navigation to adresses in your phone its address book & realtime traffic jam avoidance </li>
<li>Watching TV (either via DVB-T, preloading via wifi or via 3g/4g online streaming)</li>
<li>Listening to real FM/DAB+ radio</li>
<li>Skype videochat (via 3g/4g)</li>
<li>Playing music via bluetooth to car radio</li>
<li>Realtime onboard diagnostic displays (requiring bluetooth)</li>
<li>Handsfree calling</li>
<li>Rearview camera</li>
<li>Play games</li>
</ul>
<br />
What's best for your wallet basically depends on if your current car radio is capable of bluetooth.<br />
Because if it isn't, you could even take out the whole thing, hook the tablet/phone output to a basic amplifier.<br />
If you have an old casette player, you can buy a special fake casette with a mini-jack connection.<br />
<br />
If your car radio is bluetooth capable, good. You can send music to the car radio via bluetooth. The bluetooth default password is usually 1234 or 0000.<br />
<br />
<br />
<b>Navigation:</b><br />
Navigation is done best via google maps. Even offline navigation. It has an option to download maps for offline use.<br />
<a href="https://support.google.com/gmm/answer/3246076">https://support.google.com/gmm/answer/3246076</a> <br />
You will need free space on your device. <br />
Let your route be calculated with wifi still enabled so that any traffic jams will be avoided.<br />
<br />
<br />
<b>Watching TV /listening radio via DVB-T:</b><br />
First, you will want to check if your area has any decent DVB-T coverage.<br />
If so, you would want some specific usb device.<br />
<br />
<u>For example:</u><br />
<ul>
<li>Hauppauge AndroiDTV 78e</li>
<li>PCTV SYSTEMS PCTV nanoStick</li>
<li><a href="http://www.pointofview-online.com/showroom.php?shop_mode=product_detail&product_id=358http://www.pointofview-online.com/showroom.php?shop_mode=product_detail&product_id=358">Point of view DVB-T dongle</a></li>
</ul>
<br />
These devices require android 4.0.3<br />
You need this app:<br />
<a href="https://play.google.com/store/apps/details?id=com.elgato.eyetv.micro.idtv&hl=nl">https://play.google.com/store/apps/details?id=com.elgato.eyetv.micro.idtv&hl=nl</a><br />
<br />
<br />
<b>Watching series/movies via wifi or 3g/4g streaming:</b><br />
You will want to follow my android HTPC guide on this blog, the part about XBMC.<br />
To avoid roaming costs, XBMC plugins 1channel and icefilms include the option to download movies/episodes.<br />
Ofcourse there are endless apps for streaming TV, but all i can say is i strongly recommend using1channel and icefilms XBMC plugin.<br />
<br />
<br />
<b>Listening to real FM/DAB+ radio</b><br />
so you took out the piece of junk broken radio that some guy left there in your epic classic car..<br />
Listening true FM can be done via different methods.<br />
First, you could simply buy a tablet with a build in FM receiver.<br />
For example, Lenovo A1000 is a nice budget pick.<br />
<br />
<br />
Second option, there is a cheap app, but with very limited device compatibility.<br />
<a href="https://play.google.com/store/apps/details?id=com.mikersmicros.fm_unlock&hl=nl">https://play.google.com/store/apps/details?id=com.mikersmicros.fm_unlock&hl=nl</a><br />
<br />
<a href="http://forum.xda-developers.com/showpost.php?p=13380058&postcount=2">http://forum.xda-developers.com/showpost.php?p=13380058&postcount=2</a><br />
List of device compatibility<br />
<br />
Next, there are some special devices for sale:<br />
Lingo iVy via USB<br />
TechniSat DAB radio DAB+, FM via Bluetooth<br />
<br />
<br />
<b>Skype videochat</b><br />
Nothing hard about this, just make sure you buy a tablet/phone with a front camera that also supports a sim card, obviously.<br />
<br />
<br />
<b>Realtime onboard diagnostic displays</b><br />So, your car is from after 1996? Congratulations, there is an ODB connector hidden somewhere.<br />
Buy an ELM327 bluetooth device (take good care not to buy a fake one), plug it in, connect, <br />
install the app Torque:<br />
<a href="https://play.google.com/store/apps/details?id=org.prowl.torquefree&hl=nl">https://play.google.com/store/apps/details?id=org.prowl.torquefree&hl=nl</a><b><br /></b><br />
<br />
<br />
<b>Rearview camera</b><br />
Its easy if your phone/tablet android version is atleast 2.3. Just enable wifi hotspot in your tablet/phone, buy a cheap wifi camera, log it in your network.<br />
Now just create a shortcut to your browser on your mainscreen, which instantly visits the camera its local url.<br />
<br />
<br />
<b>So, maybe you would want to both charge your phone and plug in a DVB-T and/or FM USB dongle?</b><br />
Simply buy the smallest hub you can find, and get an mini-usb male to usb female adapter.<br />
<br />
<br />
<br />
All you need now is a proper mount/location for the desired configuration in your car.<br />
<h1 itemprop="name">
</h1>
<br />Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com1tag:blogger.com,1999:blog-4769629815000975122.post-23055669931679938872013-02-16T20:26:00.005-08:002017-09-16T08:15:47.745-07:00Android xml / rss tag / attribute parser for (image) display (in android app)My first app was a very simple image gallery,<br />
with 3 buttons, calling 3 different urls in a webview.<br />
This url was a php script that i wrote.<br />
<br />
<br />
<br />
<br />
The host with this script would be queried like this:<br />
<br />
http://your.host/fde-xmlparser.php?latest=1<br />
http://your.host/fde-xmlparser.php?id=40<br />
http://your.host/fde-xmlparser.php (skips to the next id automatically, everytime) <br />
<br />
which grabs image links from any RSS feed (in my case, supplied by phoca gallery). The script returns the contents of these files, so they can be directly viewed in any (mobile) webbrowser.<br />
<br />
<br />
It supports alot:<br />
None of the rss feed, php script, or the images need to be on the same host.<br />
It reverts to local image fetching when script + images are on the same host, useful for hosts without url wrapper and curl. Note that in this case, the php script needs to be in the same or a parent folder of the images.<br />
<br />
This feed can be queried with an html tag (setting) and attribute (setting).<br />
Buildin support allows for file-location altering (find / replace), so for example, small thumbnail links can be changed into normal links.<br />
<br />
<br />
These calls can be made from for example, google app-inventor like this: <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://xml-links-to-app-inventor.googlecode.com/files/xmlparser.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://xml-links-to-app-inventor.googlecode.com/files/xmlparser.jpg" width="320" /></a></div>
<br />
It's not very hard to accomplish in android studio either, if you follow the <br />
<a href="http://developer.android.com/training/index.html">Android studio Training</a>.<br />
<br />
There you have it, an super easy image gallery, suitable for lots of digital artists.<br />
<br />
Download here: <br />
<a href="http://code.google.com/p/xml-links-to-app-inventor/">http://code.google.com/p/xml-links-to-app-inventor/</a> <br />
<br />
<br />
Dont forget to check out my main project, <a href="http://www.bartbosma.eu/freedomeditor/">http://www.bartbosma.eu/freedomeditor/</a><br />
<br />Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-46562794903982882082013-02-16T20:26:00.002-08:002013-02-16T20:38:29.112-08:00Windows 7 and S.M.A.R.T. feature (hard drive reliability warning)I noticed that by default, (my version of) Windows 7 doesn't warn about early hard drive errors.<br />
I've read somewhere that they didn't want to bug end-users with the problems their system administrator should deal with. In the past, microsoft their policy certainly seemed quite the opposite. Now lets make it clear, of all things the end-user SHOULD be bothered with, is the safety of their personal data.<br />
<br />
Here is a quick fix.<br />
<br />
Put below in a blabla.reg file,<br />
or goto start> run > regedit and change it manual:<br />
<br />
Windows Registry Editor Version 5.00<br />
<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{29689E29-2CE9-4751-B4FC-8EFF5066E3FD}]<br />
"ScenarioExecutionEnabled"=dword:00000001<br />
"EnabledScenarioExecutionLevel"=dword:00000002<br />
"DfdAlertTextOverride"="Hard Drive Failure"<br />
<br />
<br />
You might want to goto control panel > folder options > view > uncheck hide extensions for known types, in order to allow easy creation of above mentioned .reg file.<br />
<br />
<br />
<br />
<br />
<br />
Now to enable a tight s.m.a.r.t. check schedule, go start > write "cmd" in search box > rightclick > run as admin<br />
<br />
schtasks /Create /F /SC weekly /D MON,TUE,WED,THU,FRI /TN "Check Hard drives for S.M.A.R.T. issues" /RL HIGHEST /TR %windir%\system32\DFDWiz.exe<br />
<br />
<br />
<br />
<br />
<br />
With this fixed, i'd like to point out that if you aren't using an extra UPS (emergency power supply), you should keep write cache disabled (as default) on your hard drive in case of a power failure.<br />
<br />
If you are using an UPS, then with the smart checks enabled you probably don't need to backup your data anymore...Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-20786903226142631072013-02-16T20:25:00.001-08:002013-02-16T20:38:58.585-08:00Filtering userinput for outputting filenames in PHPSo you have a string, want to turn it into a legit filename, or just display the string in html compatible mode?<br />
<br />
<b>if (!function_exists("filesystemcode")){<br />
<br />
function filesystemcode($string, $arr1="a", $arr2="b") {<br />
$c=<a href="http://php.net/array">array</a>();<br />
if (<a href="http://php.net/isset">isset</a>($arr1)) {<br />
if (!<a href="http://php.net/isset">isset</a>(${$arr1}) || !<a href="http://php.net/is_array">is_array</a>(${$arr1})){<br />
${$arr1} = <a href="http://php.net/array">array</a>('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');<br />
}}<br />
<br />
if (<a href="http://php.net/isset">isset</a>($arr2)) {<br />
if (!<a href="http://php.net/isset">isset</a>(${$arr2}) || !<a href="http://php.net/is_array">is_array</a>(${$arr2})){<br />
${$arr2} = <a href="http://php.net/array">array</a>('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");}else{$b='';}<br />
}<br />
if (<a href="http://php.net/isset">isset</a>($a) && <a href="http://php.net/isset">isset</a>($b)){<br />
return <a href="http://php.net/str_replace">str_replace</a>($a, $b, $string);<br />
}else{<a href="http://php.net/return">return</a>($string);}<br />
<br />
}<br />
}<br />
</b><br />
<br />
Remove html compatible encoded illegal filename characters:<br />
<br />
<b>//$string="%21dad";<br />
$string=filesystemcode($string, "a", "c");<br />
//echo $string; //"dad";<br />
</b><br />
<br />
<br />
Remove illegal filename chars:<br />
<br />
<b>//$string="/dad";<br />
$string=filesystemcode($string, "b", "c");<br />
//echo $string; //"dad";<br />
</b><br />
<br />
<br />
<br />
Convert filesystem incompatible chars into html compatible chars:<br />
<br />
<b>//$string="!dad";<br />
$string=filesystemcode($string, "b", "a");<br />
//echo $string; //"%21dad";</b><br />
<br />
<br />
<br />
Convert html compatible chars into filesystem incompatible chars:<br />
<b><br />
//$string="%21dad";<br />
$string=filesystemcode($string, "a", "b");<br />
//echo $string; //"!dad";</b><br />
<br />
<br />
Note, usually you would want to urlencode($string) afterwards.<br />
Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-8544901892112528282013-02-16T20:24:00.003-08:002013-02-16T20:36:21.135-08:00Howto pick Custom PC parts for dummys..Hey, decided to write an quick introduction guide for beginners at picking parts for building a computer.<br />
<br />
Basically the checklist of items you need to buy are:<br />
<br />
* Some tower<br />
* Power Supply Unit<br />
* Mainboard<br />
* Processor + cooler<br />
* Internal memory<br />
* HDD and/or SDD<br />
* Videocard, depending on mainboard (does it have onboard videocard?)<br />
<br />
<br />
The hard part is deciding which brand/models you want.<br />
<br />
If you're in the used parts market and planning to buy from individuals instead of legit companys: Only buy individual parts for the right price (LOW), as the risk is just too high.<br />
Best to either buy a complete used pc, or buy new parts. When you're gonna visit someone to test a complete pc, ask them to turn on the software Memtest86 atleast half a day before you come over.<br />
When you're there it shouldn't report any errors, should report you how long it has been running, if memtest86 doesn't error, go install the software <a href="http://www.almico.com/speedfan.php">speedfan</a>, and investigate the s.m.a.r.t. values of the hard drive. Memory errors aren't always caused by bad sticks, they can sometimes be caused by a bad mainboard, so take good care.<br />
<br />
<br />
<b>The PSU</b><br />
<br />
<i>Practical:</i><br />
<br />
* Don't buy more then twice amount of watts that you need, for efficiency cause.<br />
<br />
* Fanless PSUs exist for a while now. Relatively new are the hybrid PSUs, whereas the fan only starts moving if the psu gets hot, or depending on make, if its working more then for example 70%. You will have to pay extra, but even most normal psu's hardly make a sound at all (real noisemakers are usually videocards and cpu coolers). Also you can cut some old bicycle tire tube, and put pieces of rubber between your psu and your tower, to minimize resonation.<br />
<br />
If you are worried about psu failure (stability), buy a redundant psu. Do make sure each redundant can supply more then enough watt to power your whole system.<br />
<br />
However, a proper psu should just never fail in its lifespan, providing that you followed the instruction manual. So, ask yourself if its worth the extra cash.<br />
<br />
Talking about resonation, we get to the technical part:<br />
<br />
<i>Technical:</i><br />
Most reviewers get paid by manufacturers and dont actually have a clue about hardware, which is proven right here : <a href="http://www.hardwaresecrets.com/article/Why-99-Percent-of-Power-Supply-Reviews-Are-Wrong/410/">http://www.hardwaresecrets.com/article/Why-99-Percent-of-Power-Supply-Reviews-Are-Wrong/410/</a><br />
<br />
That said, here is a list of sites that actually properly test PSUs:<br />
<br />
<a href="http://www.hardwaresecrets.com/article/Hardware-Secrets-Power-Supply-Test-Methodology/522/7">http://www.hardwaresecrets.com/article/Hardware-Secrets-Power-Supply-Test-Methodology/522/7</a><br />
<br />
Note that <a href="http://hardwaresecrets.com">hardwaresecrets.com</a>itself also posts reviews about psus.<br />
<br />
<br />
<b>Mainboard / Processor</b><br />
It gets tricky here.<br />
<br />
I usually consider the cheapest option, as i usually replace my mainboard long before cheap components might die (which can be about 5 years).<br />
<br />
You should make sure that you're buying the proper socket, one which has cpus available in a price range between 150 euro/175 dollar and 5000. Usually you then buy the 150 dollar cpu and 3 years later you buy the fastest cpu for that board for 150 as a cheap good upgrade.<br />
<br />
<a href="http://en.wikipedia.org/wiki/CPU_socket">http://en.wikipedia.org/wiki/CPU_socket</a><br />
<br />
It's important to pick a high bus speed, and goto the website of the manufacturer to check if the mainboard supports the (almost) fastest memory on the market. Sometimes its important to check for things like for example USB3, SATA 3.2 (is for connecting hard drives). when a new technology is introduced only a tiny amount of budget boards carry it.<br />
<br />
If you can't afford a single bit of data corruption ever, your mainboard (and memory) needs to support ECC, which stands for error correction (needs to be enabled in bios).<br />
<br />
These errors usually are the results of influences like radiation or sunflares, so mostly these mainboards are only used in (web)servers and science and financial systems like banks.<br />
<br />
<br />
<b>Internal memory</b><br />
<br />
Just 3 things which are really important:<br />
<br />
* does it fit your mainboard?<br />
* Speed<br />
* ECC (Registered = ECC, unbuffered = no ECC)<br />
<br />
<br />
<b>HDD and/or SSD</b><br />
<br />
for SSD drives just go here:<br />
<a href="http://www.chip.de/bestenlisten/Bestenliste-Solid-State-Disks-SSD--index/index/id/1016/">http://www.chip.de/bestenlisten/Bestenliste-Solid-State-Disks-SSD--index/index/id/1016/</a><br />
<br />
Perhaps also here:<br />
<a href="http://www.tomshardware.com/charts/hard-drives-and-ssds,3.html">http://www.tomshardware.com/charts/hard-drives-and-ssds,3.html</a><br />
<br />
* It's best to make sure that your ssd controller has professional ECC <br />
* SSD is a relative new type of hard drive, therefore i don't recommend em just yet, unless you search and read about your choice extensively before you actually buy it.<br />
<br />
For a HDD, just get alot of cache and if you don't like noise, get a low RPM drive. more RPM equals a quicker drive, however it's a really annoying sound..<br />
Since hdds usually hold your data, you should extensively research those before you decide they are good enough for your cause. <br />
<br />
<b>Videocard</b><br />
<br />
If your mainboard doesnt have onboard videocard, and you aren't a gamer, then i highly suggest to buy a fanless card. If you are a gamer then my opinion is always stick to nvidia. They had good linux support when ati had none, they had reliable drivers for windows when ati still had BSODs. They're just 1 step ahead imo.Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0tag:blogger.com,1999:blog-4769629815000975122.post-82914224681713657922013-02-16T20:23:00.002-08:002013-02-16T20:37:11.918-08:00The official CAPTCHA boycot.<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF3AHGEFtokSiZKkkRf2DKk1m9RB5nnS63Pn-SbvS9dpfPftCAlZE_J3d26ekArYnq_OS0aE9CNezo75ea7vUqNVJ59jSohkj-UdBFlDA_1ilLnjSipk6ETzZDz0L6n6K20MRYqH_cL79l/s1600/captcha-overzicht.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF3AHGEFtokSiZKkkRf2DKk1m9RB5nnS63Pn-SbvS9dpfPftCAlZE_J3d26ekArYnq_OS0aE9CNezo75ea7vUqNVJ59jSohkj-UdBFlDA_1ilLnjSipk6ETzZDz0L6n6K20MRYqH_cL79l/s320/captcha-overzicht.png" width="320" /></a></div><br />
Dear readers.<br />
<br />
For years now, all the internet users have been proving to websites that they are not robots, thanks to a small group of exploiters, who automate crawlers to post their link everywhere on the internet.<br />
<br />
For these same years, there have been alternate methods to keep spammers out, but webmasters and programmers are either too LAZY to adept, or too scared of not being mainstream, causing all of us to waste our energy into telling a computer for example that 2+2=4, as if a 50 year old computer couldn't calculate that.<br />
<br />
So how can we stop this pure timewasting? Share this post to any webmaster or webprogrammer or website that you know.<br />
If you arent one of those, then you are allowed to stop reading now, as the stuff below doesnt concern you.<br />
<br />
<br />
Below here is the example of an alternate method to keep spammers out, this one is written in PHP, but any web programming language can use this method. Smallest issue is that anyone submitting a form using this method, needs to have cookies plus javascript enabled, but c'mon, this is 2013, not the middle ages. Most captcha scripts also require javascript enabled anyway.<br />
<br />
------------------<br />
form html:<br />
-------------<br />
<form class="sec" action="formhandler.php"> <br />
<input type="text" name='required" <br />
onfocus="<br />
var d= new Date();<br />
$.get('handlers/token.php?'+d.getTime()+'='+d.getTime(), <br />
function (txt){ <br />
$('.sec').append('<input type=\'hidden\' name=\'ts\' value=\''+txt+'\' />');<br />
});<br />
this.focus;this.select();<br />
"<br />
<br />
You can see this small part is written partly in jQuery markup, feel free to re-write it in normal javascript.<br />
You can also note we need a token.php file.<br />
<br />
<br />
<br />
<br />
------------ <br />
token.php:<br />
------------ <br />
<?php<br />
<br />
$ct=time();<br />
setcookie('token',md5($_SERVER['SERVER_SIGNATURE'].$_SERVER['PATHEXT'].$_SERVER['HTTP_USER_AGENT'].$ct), 0, '/');<br />
echo $ct;<br />
<br />
?> <br />
<br />
<br />
<br />
--------------<br />
handler.php:<br />
--------------- <br />
<?php<br />
$formtimeout=60*20; # 20 minute for fill in a form <br />
<br />
<br />
<br />
$override="o"; # "on" for disable spammerprotection<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
## anti spambot validation<br />
if (isset($_POST['ts']) && isset($_COOKIE['token']) && $_COOKIE['token']==md5($_SERVER['SERVER_SIGNATURE'].$_SERVER['PATHEXT'].$_SERVER['HTTP_USER_AGENT'].$_POST['ts']) && (int)$_POST['ts']+$formtimeout > time()){<br />
#$allowsql=true;<br />
}else{ if ($override!="on"){<br />
<br />
#spamprotect debugging<br />
#echo md5($_SERVER['SERVER_SIGNATURE'] . $_SERVER['PATHEXT']. $_SERVER['HTTP_USER_AGENT']. $_POST['ts']). "<hr />";echo $_COOKIE['token']."<hr />";<br />
#if ((int)$_POST['ts']+$formtimeout > time()){echo (int)$_POST['ts']+$formtimeout."<hr />";echo time();}<br />
<br />
#possible unsafe user redirect to main page<br />
#header("Location: ../index.html");<br />
die("unsafe user");}<br />
}<br />
<br />
#your form processing here<br />
<br />
?>Boris Boefhttp://www.blogger.com/profile/14745370367000567473noreply@blogger.com0