Skip to content

Instantly share code, notes, and snippets.

@gautamk
Created April 27, 2012 12:08
Show Gist options
  • Save gautamk/2508674 to your computer and use it in GitHub Desktop.
Save gautamk/2508674 to your computer and use it in GitHub Desktop.
Various Command and Scripts to remember
#!/bin/bash
/path/to/eclipse &
P=`which eclipse`
disown `pidof ${P}`
#!/bin/bash
##################################
# A nautilus script to open gnome-terminal in the current directory
# place in ~/.gnome2/nautilus-scripts
##################################
# Remove file:// from CURRENT_URI
gnome-terminal --working-directory=`echo "$NAUTILUS_SCRIPT_CURRENT_URI" | cut -c 8-`
Recording
This will record a lossless video using the 'huvvyuv' codec at 1024x768 resolution at 25 frames per second.
ffmpeg -f x11grab -r 25 -s 1024x768 -i :0.0 -vcodec huffyuv -sameq screencast.avi
Converting to other formats
MPEG2
ffmpeg -i screencast.avi -f mpeg2video -sameq mpeg2.mpg
MPEG4 4.2
Convert MPEG2 video (created above) into MPEG4. This should play back in Windows Media Player.
mencoder -forceidx -mc 0 -noskip -skiplimit 0 -ovc lavc -lavcopts vcodec=msmpeg4v2:vhq -o windows_mpeg4.avi mpeg2.mpg
MPEG4
ffmpeg -i screencast.avi -sameq mpeg4.avi
X264
Convert HuffYUV AVI to mp4 (libx264) video.
ffmpeg -i screencast.avi -vcodec libx264 -sameq libx264.mp4
XVid
ffmpeg -i Lossless-HuffYUV.avi -vcodec libxvid -aspect 1.3333 -sameq XviD.avi
# Service Commands
# Meddling with services on Ubuntu
# Command to start / stop / restart and check the status of services
sudo service <service_name> (status/start/stop/restart)
# Enable disable a service
sudo update-rc.d <service_name> (enable/disable)
# mysql uses an Upstart job, to disable it, create an "override" file:
echo "manual" | sudo tee /etc/init/mysql.override
#!/bin/bash
##################################
# A nautilus script to open sublime text in the current directory
# place in ~/.gnome2/nautilus-scripts
##################################
# Remove file:// from CURRENT_URI
cd `echo "$NAUTILUS_SCRIPT_CURRENT_URI" | cut -c 8-`
sublime-text-2 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment