Skip to content

Instantly share code, notes, and snippets.

@mestia
mestia / perl_and_getpw_friends
Created April 20, 2015 16:49
perl_and_getpw_friends
get the primary group of a user
perldoc -f getpwnam
( $name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell, $expire ) = getpw*
perl -E "print scalar getgrgid((getpwnam(alex))[3])"
@mestia
mestia / grsec_patched_kernel
Created February 6, 2015 14:08
grsec_patched_kernel
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.31.tar.xz
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.31.tar.sign
gpg --keyserver hkp://keys.gnupg.net --recv-keys 6092693E
xz -cd linux-3.14.31.tar.xz | gpg --verify linux-3.14.31.tar.sign -
tar -xvf linux-3.14.31.tar
gpg --recv-keys 4245D46A GRSEC key
wget https://grsecurity.net/stable/grsecurity-3.0-3.14.31-201502021853.patch
wget https://grsecurity.net/stable/grsecurity-3.0-3.14.31-201502021853.patch.sig
gpg --verify grsecurity-3.0-3.14.31-201502021853.patch.sig
/etc/grml/fai/config/files/usr/bin/sshme/AUTOSSH
-----
#!/bin/bash
user='user'
password='password'
host='mysshserver.org'
sshd_pid=$(pidof sshd)