Skip to content

Instantly share code, notes, and snippets.

# socks over ssh tunnel
# ssh server set up #
# edit the sshd_config with nano as root
# sudo su
NapoleonWils0n / hdiutil.txt
Created Nov 4, 2012
macosx: hdiutil creating disk images
View hdiutil.txt
Creating Internet-enabled Disk images
hdiutil internet-enable -yes /Path/to/image/myapp.dmg
burn an iso
# ============================
# = Editing Files with 'sed' =
# ============================
# 'sed' stands for Stream EDitor and is used to edit files automatically. It reads a file line by line, edits each line as directed by a
# list of commands, and spits out the changed line. 'sed' does a lot, much more than I can cover in this tutorial. A fuller tutorial on
# 'sed' will appear in an Advanced Lesson.
NapoleonWils0n / base64url.php
Created Nov 3, 2012
php: base64 encode image by url
View base64url.php
<!DOCTYPE html>
<html lang="en-GB">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Semantic html 5</title>
<img src="data:image/jpg;base64,<?php echo base64_encode(file_get_contents("image.jpg")) ?>" height="19" width="78" alt="base64" />
NapoleonWils0n / MPlayer play files recursively in a directory.txt
Created Nov 11, 2012
mplayer: play files recursively in a directory
View MPlayer play files recursively in a directory.txt
MPlayer play files recursively in a directory.
I wanted to have my files played in alphabetical order and only avi files (since a couple .srt subtitle files were in there…), so I came up with this :
mplayer -playlist <(find "$PWD" -name "*.avi" -type f | sort)
NapoleonWils0n / Apache_rewrite_to_Amazon_S3.txt
Created Nov 2, 2012
apache: apache rewrite to amazon s3 bucket
View Apache_rewrite_to_Amazon_S3.txt
<Directory "/www/sitename/folder/">
<IfModule mod_rewrite.c>
RewriteEngine ON
RewriteRule ^(.*)$1
# ========================
# = curl test gzip times =
# ========================
# Time with Gzip:
curl --silent -H "Accept-Encoding: gzip,deflate" --write-out "time_total=%{time_total}\n" --output /dev/null
# ssh relay server #
# use a ssh server a middle man
# to connect 2 computers behind firewalls
NapoleonWils0n / ffmpeg combine
Created Nov 4, 2012
ffmpeg: combine seperate audio and video files into a single video
View ffmpeg combine
# ffmpeg combine seperate audio and video files into a single video
# copy the audio and video tracks
ffmpeg -i audio.aiff -i -acodec copy -vcodec copy -f mp4 avcombined.mp4
# encode the audio as aac and copy the video track without encoding it. if its the h264 codec
ffmpeg -i audio.aiff -i -acodec libfaac -ac 2 -ar 48000 -ab 160k -vcodec copy -f mp4 avcombined.mp4
NapoleonWils0n / install google chrome on
Created Nov 3, 2012
linux: install google chrome on debian
View install google chrome on
# install google chrome on debian
# download google chrome
# install the deb file
sudo dpkg -i google-chrome-stable_current_i386.deb
# you need to install libcurl3