This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# requires curl and python 2.7 to be installed | |
curl -s -o get-pip.py -L https://bootstrap.pypa.io/get-pip.py && \ | |
python get-pip.py --root $(pwd)/tmppython | |
PATH=$(pwd)/tmppython/usr/local/bin:$PATH \ | |
PYTHONPATH=$(pwd)/tmppython/usr/local/lib/python2.7/dist-packages/:$PYTHONPATH \ | |
pip install --root $(pwd)/tmppython virtualenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- src/chpst.c.orig 2009-10-04 22:44:02.000000000 +0200 | |
+++ src/chpst.c 2012-09-20 20:53:01.000000000 +0200 | |
@@ -168,7 +168,13 @@ | |
struct rlimit r; | |
if (getrlimit(what, &r) == -1) fatal("unable to getrlimit()"); | |
- if ((l < 0) || (l > r.rlim_max)) | |
+ if (l > r.rlim_max) { | |
+ if (geteuid() == 0) | |
+ r.rlim_cur =r.rlim_max =l; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# usage: authkeys-report <authorized_keys-file> | |
set -ue | |
tmp="$(mktemp -t fingerprint-authkeys.XXXXXXXX)" | |
trap 'rm -f "$tmp"' 0 | |
while read opts key; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get current swap usage for all running processes | |
# based on http://northernmost.org/blog/find-out-what-is-using-your-swap/ | |
# by Erik Ljungstrom 27/05/2011 | |
SUM=0 | |
OVERALL=0 | |
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do | |
PID=`echo $DIR | cut -d / -f 3` | |
PROGNAME=`ps -p $PID -o comm --no-headers` | |
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# simple script to toggle on/off the camera of my eeepc 1000ha | |
camera=/sys/devices/platform/eeepc/camera | |
if [ `cat $camera` -eq 1 ] | |
then | |
echo -n "disabling the camera..." | |
echo 0 > $camera | |
lsusb |grep "UVC Webcam" 2>&1 >/dev/null | |
if [ $? -eq 1 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# simple windows backup system | |
# I was fed up to continuously reinstall my mum's windows so I came up | |
# with this system. | |
# she has 3 partitions as follows: | |
# hda1- windows system partition (15GB) | |
# hda2- a swapless basic debian partition (20GB) | |
# hda3- windows data partition | |
# | |
# * windows is configured so the user data are on the windows data partition |