Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
NapoleonWils0n / Set_Help_Viewer_window_to_non-floating_mode.txt
Created November 11, 2012 00:36
macosx: Set Help Viewer window to non-floating mode
Set Help Viewer window to non-floating mode.
have an icon in the Dock for Help Viewer
and how to set its windows to non-floating mode.
In DevMode Help Viewer has an icon in the Dock
and its windows are non-floating windows.
To activate Help Viewer DevMode type this in a terminal window:
@NapoleonWils0n
NapoleonWils0n / hdiutil.txt
Created November 4, 2012 23:12
macosx: hdiutil creating disk images
hdiutil
Creating Internet-enabled Disk images
hdiutil internet-enable -yes /Path/to/image/myapp.dmg
burn an iso
@NapoleonWils0n
NapoleonWils0n / meld_over_ssh.sh
Created November 11, 2012 01:16
ssh: meld over ssh
#!/bin/sh
# ==============================================
# = Using meld to compare directories over ssh =
# ==============================================
# Set up a ssh public private key and copy to your server
meld <(ssh 192.168.1.2 ls Desktop) <(ls Desktop)
@NapoleonWils0n
NapoleonWils0n / ffmpeg combine files.sh
Created November 4, 2012 00:26
ffmpeg: combine seperate audio and video files into a single video
#!/bin/sh
# ffmpeg combine seperate audio and video files into a single video
# copy the audio and video tracks
ffmpeg -i audio.aiff -i video.mov -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 video.mov -acodec libfaac -ac 2 -ar 48000 -ab 160k -vcodec copy -f mp4 avcombined.mp4
@NapoleonWils0n
NapoleonWils0n / install google chrome on debian.sh
Created November 3, 2012 00:43
linux: install google chrome on debian
#!/bin/sh
# 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
@NapoleonWils0n
NapoleonWils0n / ssh_relay_server.sh
Created November 11, 2012 15:39
ssh: ssh relay server
#!/bin/sh
#-----------------------------------------------------------#
# ssh relay server #
#-----------------------------------------------------------#
# use a ssh server a middle man
# to connect 2 computers behind firewalls
@NapoleonWils0n
NapoleonWils0n / ssh_socks_proxy_setup.sh
Created November 11, 2012 19:18
ssh: ocks over ssh tunnel
#!/bin/sh
# socks over ssh tunnel
#----------------------------------------------------------------------------------------#
# ssh server set up #
#----------------------------------------------------------------------------------------#
# edit the sshd_config with nano as root
# sudo su
@NapoleonWils0n
NapoleonWils0n / sed_commands.sh
Created November 11, 2012 00:32
sed: sed commands
#!/bin/sh
# ============================
# = 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
NapoleonWils0n / base64url.php
Created November 3, 2012 01:10
php: base64 encode image by url
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Semantic html 5</title>
</head>
<body>
<img src="data:image/jpg;base64,<?php echo base64_encode(file_get_contents("image.jpg")) ?>" height="19" width="78" alt="base64" />
@NapoleonWils0n
NapoleonWils0n / MPlayer play files recursively in a directory.txt
Created November 11, 2012 00:14
mplayer: play files recursively in a directory
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)