Commits

Radu Potop committed decf712

initial commit

Comments (0)

Files changed (12)

+#!/bin/bash
+# Batch lame encoder.
+
+find "$1" -name '*.wav' -type f -exec lame --replaygain-accurate -q2 -V0 --vbr-new {} \; -exec rm {} \;
+#!/bin/bash
+# Display cpu fan & temp every given seconds.
+
+while (true) do
+    echo
+    sensors|grep 'CPU'|cut -f 1 -d "("
+    sleep $1
+done
+#!/bin/bash
+# Unmount fuse media.
+
+fusermount -u /media/"$1"
+#!/bin/bash
+# Extract files.
+
+if [ -f $1 ] ; then
+    case $1 in
+        *.tar*)     tar xf $1   ;;
+        *.gz)       gunzip $1   ;;
+        *.bz2)      bunzip2 $1  ;;
+        *.tgz)      tar xf $1   ;;
+        *.tbz2)     tar xf $1   ;;
+        *.zip)      unzip $1    ;;
+        *.rar)      unrar x $1  ;;
+        *.Z)        uncompress $1   ;;
+        *.7z)       7z x $1 ;;
+        *)          echo "'$1' cannot be extracted" ;;
+    esac
+else
+    echo "'$1' is not a valid file"
+fi
+#!/bin/bash
+# Mount various media with fuse.
+
+case "$1" in
+    "phone")
+        address=`hcitool scan|awk '{if (NR==2) print $1}'`
+        obexfs -b $address -B 10 /media/"$1"
+        ;;
+    "iso")
+        fuseiso "$2" /media/"$1"
+        ;;
+esac
+#!/bin/bash
+# Download various files according to a pattern.
+
+for x in $(seq 0 999); do
+    #wget http://www.ponandzi.com/images/$x.jpg
+done
+#!/bin/bash
+# MicroID generator.
+# usage: microid mail site
+
+mail=`echo -n "mailto:$1" | sha1sum | cut -f 1 -d " "`
+site=`echo -n "http://$2" | sha1sum | cut -f 1 -d " "`
+id=`echo -n "$mail$site" | sha1sum | cut -f 1 -d " "`
+
+code=`echo '<meta name="microid" content="mailto+http:sha1:'$id'" />'`
+echo $code
+#!/bin/bash
+# Uses gnokii to save the phonebook from a phone.
+
+gnokii --getphonebook ME 1 end -v > phone.vcs
+#!/bin/bash
+# Rename files to date_hash.ext
+
+for file in *.jpg
+do
+    date=`ls -l --time-style=long-iso "$file"|cut -f 6 -d " "`
+    hash=`md5sum "$file"|cut -f 1 -d " "`
+    ext=`ls "$file"|cut -f 2 -d "."`
+    mv "$file" "$date"_"$hash"."$ext"
+done
+#!/bin/bash
+# Transform the pacman cache into a repo. Usefull for updating machines on a LAN.
+
+pacman -Syuw --noconfirm &> /dev/null
+
+cd /var/cache/pacman/pkg/
+cp /root/dummy-1-1-any.pkg.tar.xz .
+repo-add -q cache.db.tar.gz *.pkg.* &> /dev/null
+#!/bin/bash
+# Resize images using Imagemagick.
+
+for file in *
+do
+    convert -resize "$1" "$file" res_"$file"
+done
+#!/bin/bash
+# Connect wlan0 to WiFi.
+
+wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf