Skip to content

Instantly share code, notes, and snippets.

@Gen2ly
Gen2ly / screencast
Created August 23, 2012 20:38
Create screencasts of area, full-screen, or window
#!/bin/bash
# Create screencasts of area, full-screen, or window
# Required program(s)
req_progs=(ffcast ffmpeg)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done
@Gen2ly
Gen2ly / cvlc.desktop
Created August 20, 2012 00:29
Type=Application
[Desktop Entry]
Type=Application
Name=cVLC
GenericName=Media Player
GenericName[ca]=Reproductor multimèdia
GenericName[de]=Medienwiedergabe
GenericName[fr]=Lecteur multimédia
GenericName[it]=Lettore multimediale
GenericName[ja]=メディアプレーヤー
X-GNOME-FullName=Command Line VLC
@Gen2ly
Gen2ly / memtop
Created August 2, 2012 23:39
Display the top application memory users
#!/bin/bash
# Display the top applications of memory usage
# http://www.cyberciti.biz/faq/linux-check-memory-usage/#comment-51021
while read command percent rss; do
if [[ "${command}" != "COMMAND" ]]; then
rss="$(bc <<< "scale=2;${rss}/1024")"
fi
printf " %-26s%-8s%s\n" "${command}" "${percent}" "${rss} MB" \
| sed 's/COMMAND/PROGRAM/' | sed 's/RSS MB/#MEM/'
@Gen2ly
Gen2ly / devtop
Created August 2, 2012 23:36
Print disk usage
#!/bin/bash
# Print disk usage
# Key word exclusions (seperated by space)
exclude=(sandfox)
df -h | grep -e '^Filesystem' -e '^/dev' | \
grep -vf <(printf "%s\n" "${exclude[@]}") | \
sed 's/^/ /g'
@Gen2ly
Gen2ly / pspvidconv
Created July 16, 2012 17:36
Convert videos to PSP
#!/bin/bash
# Convert videos to PSP
# Settings
vid_dir=/run/media/$USER/PSP/VIDEO # For Gnome 3, Gnome 2: /media/PSP/VIDEO
vid_vcd="-vcodec mpeg4 -vtag xvid" # Video codec: xvid
vid_vcd="-vcodec libx264" # Video codec: x264
vid_vcd="-vcodec h264"
vid_res=320x240 # 320x240 for PSP 1001, 480x272 for 2001
vid_vbr=768k # Video bit rate, was 1024
@Gen2ly
Gen2ly / md2wp
Created July 9, 2012 23:34
Convert Markdown to Wordpress blogging format
#!/bin/bash
# Convert Markdown to Wordpress blogging format
# Required program(s)
req_progs=(ascii2uni pandoc)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done
@Gen2ly
Gen2ly / 90_externalmonitor
Created July 7, 2012 12:09
Enable external monitor if connected and disable laptop monitor, else v.v.
#!/bin/sh
# Enable external monitor if connected and disable laptop monitor, else v.v.
case "$1" in
resume | thaw )
export DISPLAY=:0
su -c - todd /home/todd/.scripts/bugfixes/externalmonitor
;;
esac
@Gen2ly
Gen2ly / Macros.xml
Created July 5, 2012 00:34
Archnophilia Macros
<?xml version="1.0" standalone="yes" encoding="UTF-8"?>
<node>
<title>Menus</title>
<tooltip>The group of default application menus</tooltip>
<node>
<title>File</title>
<menu>true</menu>
<leaf>
<title>NewAuto</title>
<tooltip>Create another of the most recently created file type</tooltip>
@Gen2ly
Gen2ly / Arach.ini
Created July 5, 2012 00:32
Archnophilia configuration
fileEncoding=UTF-8
fileSaveEOL=\n
tableWizData=[backgroundColor=-3866625,borderColor=-6291456,titleRowColor=-2490669,defaultRows=4,defaultColumns=4,tableWidth=95,borderWidth=1,cellPadding=4,cellSpacing=0,dataDelimiter=44,commentMarkers=true,centerData=false,placeholderData=true,boldFirstRow=true,titlecolorFirstRow=false,boldFirstColumn=true,titlecolorFirstColumn=false,colorBackground=false,colorBorder=false]
pageBackgroundColor=376926741
pageTextColor=0
pageLinkColor=255
pageActiveLinkColor=16711680
pageVisitedLinkColor=8388736
beepLevel=0.5
contentSplitPaneLoc=1
@Gen2ly
Gen2ly / pacpull
Created June 29, 2012 17:35
Download package source files
#!/bin/bash
# Download package source files
# Download directories for source files (official and for the AUR) are defined
# /etc/abs.conf and in the cower config respectively
# Required program(s)
req_progs=(abs cower)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \