NVIDIA OpenGL headers
sudo apt-get install nvidia-current-dev
DEAR READER

Discoholic 🪩

JBB: An Artblog!
cherry valley forever
ojovivo
I'd rather be in outer space 🛸
we're not kids anymore.
AnasAbdin
Cosmic Funnies
Lint Roller? I Barely Know Her
KIROKAZE
almost home

Origami Around

dirt enthusiast
Alisa U Zemlji Chuda

Janaina Medeiros
styofa doing anything
Sweet Seals For You, Always

Kaledo Art

seen from Australia
seen from Türkiye

seen from France

seen from Germany
seen from Germany

seen from Australia

seen from Switzerland

seen from United States

seen from Malaysia
seen from Türkiye

seen from Malaysia

seen from Saudi Arabia

seen from Vietnam
seen from Türkiye
seen from Türkiye

seen from Türkiye
seen from United States

seen from France

seen from Australia

seen from United States
@angrynerd
NVIDIA OpenGL headers
sudo apt-get install nvidia-current-dev

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Make Ubuntu numpad behave as in Windows
On Windows, you can hit the numpad arrow/home/end keys while holding down Ctrl+Shift to rapidly select text on any application. That doesn't work on Ubuntu (14.04) by default. Here's how to fix it: 1. Type sudo gedit /etc/default/keyboard on the terminal. 2. Go to the line that says XKBDOPTIONS="". 3. Change it to XKBDOPTIONS="numpad:microsoft".
Git idioms #1 -- resolve diverged branches
So git status is saying "Your branch and 'origin/master' have diverged, blah blah" -- now what?
The easiest way to resolve the divergence is to ditch your local changes and start over from the latest origin/master:
git reset --hard origin/master
If you don't want to ditch the local commits you need to do a rebase instead of a reset:
git rebase origin/master
So how do you know if there's anything in the local commits that's worth keeping? You review the commit log and the diff:
git log HEAD..origin/master git diff HEAD..origin/master
Sync file dates recursively
BASE_OLD=/media/HD-PZU3/Videos/ BASE_NEW=/media/LaCie/Videos/ cd $BASE_OLD find . -type f | while read fname do TS=$(stat -c '%Y' "${BASE_OLD}/${fname}") TIMESTAMP=$(date -d @${TS} +'%d %b %Y %R') touch -d "${TIMESTAMP}" "${BASE_NEW}/${fname}" echo "${BASE_NEW}/${fname}" done
Extracting video file timestamps
if [ -z "$1" ]; then echo "Usage: fix-video-dates.sh " echo "Example: fix-video-dates.sh /media/LaCie/Videos" exit 1 fi find ${1} -type f | while read fname do TIMESTAMP=$(mediainfo ${fname} | grep -i --max-count=1 'date.*20[01][0-9]' | cut --characters=44- -) if [ -z "${TIMESTAMP}" ]; then echo "No valid timestamp found for ${fname}; skipping." else echo ${fname} ${TIMESTAMP} touch -d "${TIMESTAMP}" "${fname}" fi done

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Disk partitioning, formatting, and mounting
Here's how to add a new disk to a Linux machine:
# fdisk /dev/xvdb ... Command (m for help): p ... Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-181975, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-181975, default 181975): Using default value 181975 Command (m for help): p Disk /dev/xvdb: 1496.7 GB, 1496796102656 bytes 255 heads, 63 sectors/track, 181975 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xc6318a63 Device Boot Start End Blocks Id System /dev/xvdb1 1 181975 1461714156 83 Linux Command (m for help): w ... # mke2fs -j /dev/xvdb1 # mkdir /mydisk # echo "/dev/xvdb1 /mydisk ext3 defaults 1 2" >> /etc/fstab # mount -a # df -H
Sources: schirmacher.de and cyberciti.biz
Making HP printers work on Linux
My HP Laserjet P1102w refused to work on Linux (Ubuntu 10.04), even after installing hplip and all the required dependencies. The printer did show up on lsusb output, though:
~/Downloads/hplip-3.12.6$ lsusb Bus 005 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 005: ID 03f0:032a Hewlett-Packard Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ~/Downloads/hplip-3.12.6$
The trouble is, the printer does not show up as a printer, but as a fake CD-ROM drive! This is because of something known as "HP Smart Install", which only works on Windows (of course). Currently the only way to fix that is to install the printer and its full driver package on Windows, and then run UTIL/SIUtility.exe to disable the Smart Install feature on the printer. Having done that, it works on Linux without a hitch.
More information and detailed instructions available here: https://bugs.launchpad.net/hplip/+bug/1002860
Installing Node.js on Linux
Here's how to install Node.js on Red Hat based Linux distributions:
wget http://nodejs.tchol.org/repocfg/el/nodejs-stable-release.noarch.rpm sudo yum localinstall --nogpgcheck nodejs-stable-release.noarch.rpm sudo yum install npm sudo yum install nodejs-compat-symlinks
JPEG lossless crop
Having figured out how to re-save a JPEG in Irfanview such that my Canon DSLR no longer gives the "unrecognized file type" error (see the previous post), I had enough confidence to try the "JPG Lossless Crop" option, too.
The good news is that it works; the bad news is that you have to be really careful with it, or you'll end up with the "unrecognized file type" error once again.
First of all, you need to manually ensure that the image width and height remain multiples of 16, which can be a bit tricky if you also wish to retain a specific aspect ratio (so go pick up that calculator). Second, the dimensions may still end up wrong, depending on how you position the crop window, so you need to check the file after cropping, and re-crop if necessary. Third, the lossless cropping mode doesn't give you the option to omit the JFIF marker, so you have to run the cropped files through the "JPG Lossless Rotation" mode to get rid of it. And fourth, there is no way to update the embedded thumbnail, so the uncropped image will still persist in the camera browsing view.
JPEG lossless operations
I was trying to be clever and did some quick editing on JPEGs while they were still sitting in my Canon 500D, but damn, the bloody camera refused to recognize any of the edited photos!
After several hours of googling and playing with Irfanview and ExifTool, I had to give up on restoring the processed photos into a state that the camera would accept -- apparently my editing software (Picasa) had mangled the files beyond recovery. Luckily, Picasa also keeps the originals tucked away, so I could go back to square one.
I then started diagnosing the problem from the opposite direction. I opened one of the originals in Irfanview and re-saved it without any changes, but no luck: the Canon still wouldn't recognize it.
Finally, I came to think about the concept of JPEG lossless operations, for which there happens to be an Irfanview plugin, and indeed, the "JPG Lossless Rotation" mode did the trick. There were a couple of pitfalls, though: the "Write JFIF Marker" and "Optimize JPG File" options must be unchecked (they are enabled by default).

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Server-side Python
#!/usr/bin/python import cgi print "Content-Type: text/html" # HTML is following print # blank line, end of headers print ''' <html><body> Hello, World! </body></html> '''
Invoking shell commands from Python
Here's how to launch a unix shell command from Python and grab its output:
import subprocess cmd = "echo Hello World" p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout output = p.readline()
Adding users to the sudoers file
First make the sudoers file writable:
sudo chmod 640 /etc/sudoers
then open the sudoers file in your favorite text editor:
sudo emacs /etc/sudoers
then find the line that reads
root ALL=(ALL) ALL
and add the following line
myaccount ALL=(ALL) ALL
Finally turn the sudoers file back to read-only:
sudo chmod 440 /etc/sudoers
Enabling HTTPS on Apache
Step-by-step instructions for setting up https connections on Apache/CentOS: http://wiki.centos.org/HowTos/Https
To avoid browser warning dialogs, you'll need a trusted certificate. GoDaddy is offering certs at a reasonable price; VeriSign has the widest coverage but is ten times more expensive.
Recovering lost videos from a memory card
I accidentally wiped out a memory card (SDHC) filled with video files (Motion JPEGs in AVI containers). After a few hours of googling and hacking, I managed to rescue everything but a few damaged frames -- thanks to Photorec and DivFix++. Highly recommended!

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Some more Apache tips
Turn off all caching to see how your site performs to a first-time visitor:
#LoadModule cache_module modules/mod_cache.so #LoadModule disk_cache_module modules/mod_disk_cache.so #LoadModule file_cache_module modules/mod_file_cache.so #LoadModule mem_cache_module modules/mod_mem_cache.so
Allowing persistent connections is typically a good idea:
KeepAlive On
Allow CGI script execution in any directory, not just cgi-bin:
<Directory "/var/www/html"> Options FollowSymLinks ExecCGI ... </Directory>
CGI script execution in arbitrary directories also requires handlers:
AddHandler cgi-script .cgi AddHandler cgi-script .py AddHandler php5-script .php
Sync JPEG file dates with their EXIF dates
Change the date and time of all .jpg files to match the time they were captured:
sudo apt-get install libimage-exiftool-perl exiftool '-DateTimeOriginal>FileModifyDate' *.jpg