Show queries in live time
You can see all running queries in live time with:
1 |
$> mysqladmin -u dbuser -p123 -i 2 processlist |
The option -i determines the number of seconds between refreshes(alias –sleep=DELAY).
You can see all running queries in live time with:
1 |
$> mysqladmin -u dbuser -p123 -i 2 processlist |
The option -i determines the number of seconds between refreshes(alias –sleep=DELAY).
Arch Linux is a very clean and lightweight Linux distribution. With the following steps you can install it on a SD-Card to run it on a Raspberry Pi: Get the device name (dev-path) of the SD-Card to run the operating system (see Get a list of partitions or List, partitioning and format drives)
1 |
$> sudo fdisk -l |
You should see […]
In earlier Magento versions it was quite difficult to set or read store specific values on entities. In most cases you have to set the store on the whole application instance like that:
1 2 3 4 5 6 |
<?php Mage::app(STOREID)->setStore(STOREID); ... $oProduct->setStore(STOREID); ... $oCollection->setStore(STOREID); |
Sometimes it was even necessary to add the store to entities or collections it-selves too. Now (at least EE 1.14) you can do […]
To append all contents of textfile1.txt to the end of textfile2.txt:
1 |
$> cat textfile1.txt >> textfile2.txt |
or to add text directly to the end of the file, you can use:
1 |
$> echo "TEST" >> testfile.txt |
To copy a SD-Card to another one including all partitions yo can take the following steps: Find out the device name (f.e.: /dev/mmcblk0): see List, partitioning and format drives or see Get a list of partitions or see Get free disk space and partitions Copy the whole card to an imagefile (Backup):
1 |
$> sudo dd if=/dev/mmcblk0 of=backup_pi.img bs=4M |
Restore the backup image to […]
Here are some nice Apache configuration entries that will increase your website performance. They can be placed in a .htaccess file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
<IfModule mod_headers.c> ## # Add a Vary Accept-Encoding header for the compressed resources. If you # modify the file types above, make sure to change them here accordingly. ## Header unset ETag # Header set Cache-Control "no-cache" -> Cache aus <FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css)$"> Header unset Last-Modified Header append Cache-Control "public, max-age=3600" </FilesMatch> <FilesMatch "\.(html)$"> Header unset Last-Modified Header append Cache-Control "public, max-age=60" </FilesMatch> # <FilesMatch "\.(js|css|xml|gz)$"> # Header append Vary Accept-Encoding # </FilesMatch> # <FilesMatch "\.(ttf|otf|eot|woff|svg)$"> # Header set Access-Control-Allow-Origin "*" # </FilesMatch> </IfModule> <IfModule mod_expires.c> ############################################ ## Add default Expires header ## http://developer.yahoo.com/performance/rules.html#expires ExpiresActive On # Attention: This line could cause unwanted caching behavior. # It's better leave it and define every contenttype you want to cache): ExpiresDefault "access plus 1 day" ExpiresByType image/x-icon A86400 ExpiresByType image/png A86400 ExpiresByType image/gif A86400 ExpiresByType image/jpg A86400 ExpiresByType image/jpeg A86400 ExpiresByType text/javascript A86400 ExpiresByType text/x-js A86400 ExpiresByType application/x-javascript A86400 ExpiresByType application/javascript A86400 ExpiresByType text/css A86400 ExpiresByType audio/mpeg A86400 # Add correct content-type for fonts AddType application/vnd.ms-fontobject .eot AddType font/ttf .ttf AddType font/otf .otf AddType font/x-woff .woff AddType image/svg+xml .svg AddType video/ogg .ogv AddType audio/ogg .ogg # Add a far future Expires header for fonts ExpiresByType application/vnd.ms-fontobject "access plus 1 day" ExpiresByType font/ttf "access plus 1 day" ExpiresByType font/otf "access plus 1 day" ExpiresByType font/x-woff "access plus 1 day" ExpiresByType image/svg+xml "access plus 1 day" ExpiresByType video/ogg "access plus 1 day" ExpiresByType video/ogg "access plus 1 day" # ^ All static resources will be cached in the client-browser and proxies for 1 day </IfModule> FileETag none |
Recently I brought this assembly kit Bluetooth led clock at Banggood: http://www.banggood.com/DIY-AT89S52-Rotation-LED-Electronic-Clock-Kit-51-SCM-Learning-Board-p-965849.html Here are some pictures showing the process: The assembly was relatively easy. Except the SMD leds, resistors, transistors and capacitors! They were a little bit harder to solder. Unfortunately the Bluetooth feature didn’t work with my actual mobile phone, that has Android 4.4 […]
A nice little tool to format your JSON objects, if you had no suitable editor ready to hand. http://jsonformatter.curiousconcept.com/
Yeah the next prank from Adafruit! They build up their own web-based development IDE. At the moment it’s only in beta state but I think the chance is very high that it will become very awesome. Right now it runs on Raspberry Pi and BeagleBone and supports Ruby, Python and JavaScript. The genius part is, that the code […]