Yeah, tomorrow will be a very, very extraordinary day, especially for me as Pi lover. Every year on March 14 it's Pi Day (http://en.wikipedia.org/wiki/Pi_Day). But this year we've got the chance to experience THE Pi Day of the century as the year 2015 will give us the next digits of Pi, which will be made perfect by the time 09:26:53. In that second, we'll live through the first ten digits of Pi! Of course, one could argue whether second 54 wouldn't be a better one because of rounding...
So stand still for that infinitesimal small moment in time and celebrate the most perfect Pi Day of your whole life!!
Here's a small collection of links and resources I stumbled upon related to this special Pi Day.
Today is Pi Day and here's my Pi Day run, even a Quad-Pi run!
Getting PHP composer to work with XAMPP on Arch Linux behind a corporate proxy (goal: install Laravel)
It took me quite some tests until I finally found a way to get all those things working together:
- Arch Linux
- Laravel (PHP framework)
- behind corporate proxy server (Squid)
So, in a nutshell, the necessary actions were:
I'm working on an updated Arch Linux with no PHP, Apache, Composer whatsoever installed by means of Pacman as my goal is to run everything out of the XAMPP box.
Corporate proxy server
I have exported the variables http_proxy and https_proxy as I'm captured behind a proxy server on my work:
export http_proxy=<proxy-ip>:<proxy-port> export https_proxy=<proxy-ip>:<proxy-port>
So no protocol prefixes for me (http://, https://), simply the plain IP addresses and port numbers.
Download and install XAMPP for Linux:https://www.apachefriends.org/download.html
Usually, this will reside under /opt/lampp after this.
Strangely, there was no cert.pem to be found in my /opt/lampp/share/openssl/ directory, even though this ought to be the case, according to
php -r "print_r(openssl_get_cert_locations());"
So I downloaded this certificate file manually from http://curl.haxx.se/ca/cacert.pem and saved it in this directory under the name "cert.pem".
Environment variable HTTPS_PROXY_REQUEST_FULLURI
I read a lot about these two environment variables:
But I definitely had to unset / delete them to prevent errors.
In order to find the PHP executable on the system, I appended "/opt/lampp/bin" to the exported PATH variable. I did this globally in /etc/profile.
Composer can be downloaded and installed into the XAMPP bin directory like so:
curl -sS https://getcomposer.org/installer | php -- --install-dir=/opt/lampp/bin --filename=composer
As this bin directory is already visible through the PATH variable, PHP and composer are now directly accessible from the command line.
Composer, Laravel and the tricky part
Officially, Laravel can be installed with this command:
composer create-project laravel/laravel --prefer-dist
To get a very verbose output, you can add the option "-vvv" after the composer command. At first, I had an awful lot of problems with this step. But having found out and done all the previous steps at last, I was able to download Laravel.
I have been wondering this for ages: Does Tommy Emmanuel, the one and only hybrid finger-picking guitarist from Australia have long fingernails on his right hand (the strumming and picking hand)?
Only recently I finally got the chance to see him live in Heidelberg (Germany) and even talk to him shortly afterwards. When I asked him that exact question he instantly said "No!". He showed me his right hand - no long fingernails! Not at all. He told me that this requests lots and lots of practising. He said that he didn't like the sound of long fingernails. It would be somewhat unnatural.
openssl genrsa -des3 -out server.key 2048 openssl rsa -in server.key -out server.key.decrypted openssl req -new -key server.key -out server.csr openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt (remove passphrase from key): cp server.key server.key.org openssl rsa -in server.key.org -out server.key
Over the last eleven years, I've developed a list with items I use to take with me when going on holiday. This list has been extended every time I forgot something. So my list has grown extremely robust and I completely trust it.
- digital camera (+ batteries)
- mobile phone (+ charger)
- alarm bell
- electric torch
- mp3 player (+ batteries)
- satnav (for the car)
- garmin gps device (+ batteries)
clothes and related stuff:
- bathing suit (+ diver eyeglasses)
- clothes (+ pyjamas, belt, tissues, cagoule)
- appropriate shoes
- sleeping bag
- bag for laundry
stuff for the eyes:
- sunglasses (+ spectacle case)
- things for contact lenses
- writing utensils (+ paper)
- things to read (books, magazines, ...)
- addresses for postcards
- guitar (+ strings)
- entertainment material (puzzles, cards, ...)
personal hygiene stuff:
- toothpaste (new one?)
- manicure set
stuff for surviving:
- wallet (driving licence, ID card, money)
I mostly try to keep as close as possible to the actual source and usage of software tools. One example is the wonderful and often used MP3 encoder LAME.
I filtered the output of the command lame --longhelp by deleting all the options that didn't seem useful for me. That's what came out:
LAME 32bits version 3.98.4 (http://www.mp3dev.org/)
usage: ./frontend/lame [options] <infile> [outfile]
lame -V2 input.wav output.mp3
-a downmix from stereo to mono file for mono encoding
-m <mode> (j)oint, (s)imple, (f)orce, (d)dual-mono, (m)ono
default is (j) or (s) depending on bitrate
joint = joins the best possible of MS and LR stereo
simple = force LR stereo on all frames
force = force MS stereo on all frames.
--decode input=mp3 file, output=wav
--quiet don't print anything on screen
--brief print more useful information
--verbose print a lot of useful information
Noise shaping & psycho acoustic algorithms:
-q <arg> <arg> = 0...9. Default -q 5
-q 0: Highest quality, very slow
-q 9: Poor quality, but fast
-h Same as -q 2. Recommended.
-f Same as -q 7. Fast, ok quality
CBR (constant bitrate, the default) options:
-b <bitrate> set the bitrate in kbps, default 128 kbps
--cbr enforce use of constant bitrate
--abr <bitrate> specify average bitrate desired (instead of quality)
-V n quality setting for VBR. default n=4
0=high quality,bigger files. 9=smaller files
-v the same as -V 4
-b <bitrate> specify minimum allowed bitrate, default 32 kbps
-B <bitrate> specify maximum allowed bitrate, default 320 kbps
-t disable writing LAME Tag
--lowpass <freq> frequency(kHz), lowpass filter cutoff above freq
--lowpass-width <freq> frequency(kHz) - default 15% of lowpass freq
--highpass <freq> frequency(kHz), highpass filter cutoff below freq
--highpass-width <freq> frequency(kHz) - default 15% of highpass freq
--resample <sfreq> sampling frequency of output file(kHz)- default=automatic
ID3 tag options:
--tt <title> audio/song title (max 30 chars for version 1 tag)
--ta <artist> audio/song artist (max 30 chars for version 1 tag)
--tl <album> audio/song album (max 30 chars for version 1 tag)
--ty <year> audio/song year of issue (1 to 9999)
--tc <comment> user-defined text (max 30 chars for v1 tag, 28 for v1.1)
--tn <track[/total]> audio/song track number and (optionally) the total
number of tracks on the original recording. (track
and total each 1 to 255. just the track number
creates v1.1 tag, providing a total forces v2.0).
--tg <genre> audio/song genre (name or number in list)
--ti <file> audio/song albumArt (jpeg/png/gif file, 128KB max, v2.3)
--tv <id=value> user-defined frame specified by id and value (v2.3 tag)
--add-id3v2 force addition of version 2 tag
--id3v1-only add only a version 1 tag
--id3v2-only add only a version 2 tag
--genre-list print alphabetically sorted ID3 genre list and exit
--ignore-tag-errors ignore errors in values passed for tags
Note: A version 2 tag will NOT be added unless one of the input fields
won't fit in a version 1 tag (e.g. the title string is longer than 30
characters), or the '--add-id3v2' or '--id3v2-only' options are used,
or output is redirected to stdout.
MPEG-1 layer III sample frequencies (kHz): 32 48 44.1
bitrates (kbps): 32 40 48 56 64 80 96 112 128 160 192 224 256 320
MPEG-2 layer III sample frequencies (kHz): 16 24 22.05
bitrates (kbps): 8 16 24 32 40 48 56 64 80 96 112 128 144 160
MPEG-2.5 layer III sample frequencies (kHz): 8 12 11.025
bitrates (kbps): 8 16 24 32 40 48 56 64
The project recommends using the -V 2 option in order to encode with a variable bitrate and a relatively good quality.
One typical usage would be the following. Here, the recommended variable bitrate quality setting is used and some of the most useful ID3-Tags are set.
lame -V 2 --tt testtitle --ta testartist --tl testalbum --ty 2011 --tc SimCoded Testsound.wav Testsound.mp3
When no option is given LAME seems to use a constant bitrate setting with 128kbps and a quality setting of 3.
If no ID3-Tags are desired, the simplest and most efficient usage would be:
lame -V 2 Testsound.wav Testsound.mp3
I've got a PC which two operating systems: Windows (XP) and Ubuntu (10.04). I had wisely installed Windows at first and after that Ubuntu, having read about Windows being more rude than Ubuntu when it comes to overwriting the master boot record.
Recently I reinstalled Windows. After rebooting, of course, Windows' boot loader had defeated Ubuntu's with the result that I couldn't see my Ubuntu during boot and thus couldn't start Ubuntu any longer...
I found a great help article about just that thing on:
The central steps which helped me out were:
- Booting an Ubuntu Live CD
- Mounting the old Ubuntu partition by clicking on the drive in the Places menu
- Console command: sudo grub-install --root-directory=/media/0d104aff-ec8c-44c8-b811-92b993823444 /dev/sda
- Be sure to previously find out the device name of the disc with Ubuntu on it as well as this long number (which can be found out by the mount command)
I've been creating a device patch file of my Roland RD-700SX stage piano for the use in Steinberg Cubase for the last months! The most important patches - actually everything except for the "GM2" section is finished!
Looking around on the web, I could indeed find one or two such prepared files but none of them really was as I had expected it...
Go to the downloads page and have a look if you're interested in it.
If you happen to have the wonderful FFmpeg, there are many cool things you can do with it. I'll name just a few things that I'm often in need of. Please note that I'm playing around with all the possibilities myself, so the following lines will grow over time...
Get information about a media file:
ffmpeg -i video.avi
Extract (demux) the audio track from a video file:
ffmpeg -i video.mts -acodec copy -vn audio.ac3
Extract (demux) the video track from a video file:
ffmpeg -i video.mts -vcodec copy -an -f h264 ffNT.h264
Merge an audio and a video track (mux):
ffmpeg -i video.h264 -i audio.ac3 -vcodec copy -acodec copy videoaudio.ts
Resize an original Full-HD (16:9) video file from a camcorder down to DVD resolution (and MPEG) for further processing, e.g. burning on DVD (e.g. with DVDStyler), but keep the source aspect ratio of 16:9:
ffmpeg -i video.ts -s 720x405 -aspect "1.7777" -vb 8000k video.mpg
Resize a video to a certain width, retaining the aspect ratio (width = 640px, in this example; the "-strict -2" may be necessary on Linux because of licence issues):
ffmpeg -i video.mp4 [-strict -2] -vf "scale=640:-1" video-resize640.mp4
I own a Dreambox DM 800 HD which is capable of sending messages to the TV via the provided web interface. If you don't want to make all the mouse clicks and wait all the time until everything is loaded, just type into your browser address line:
text=somemessage is the text to send
type=0 refers to the type of the message (info, warning...)
timeout=5 causes the message to be displayed for 5 seconds