Skip to content

Instantly share code, notes, and snippets.

View grenade's full-sized avatar

rob thijssen grenade

View GitHub Profile
@grenade
grenade / gist:5524002
Created May 6, 2013 08:31
Touch failing in Vagrant on custom Fedora image
INFO subprocess: Starting process: ["C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe", "showvminfo", "32a4ff0e-198b-463c-ac16-2e20508cf61a", "--machinereadable"]
INFO ssh: Attempting SSH. Retries: 100. Timeout: 30
INFO ssh: Attempting to connect to SSH...
INFO ssh: - Host: 127.0.0.1
INFO ssh: - Port: 2222
INFO ssh: - Username: vagrant
INFO ssh: - Key Path: D:/vagrant_home/insecure_private_key
INFO ssh: SSH is ready!
INFO interface: info: VM booted and ready for use!
[default] VM booted and ready for use!
@grenade
grenade / Install web2py under apache on FC18
Last active December 21, 2015 01:48
Make web2py run under Apache mod_wsgi on Fedora Core 18
# Dependencies
yum -y install openssh-server python python-devel tkinter sqlite-devel zlib-devel httpd httpd-devel mod_wsgi mod_proxy_html mod_ssl wget
# web2py
rm -rf /var/www/html/web2py
chmod 755 /var/www/html
git clone https://github.com/web2py/web2py.git /var/www/html/web2py
ln -s /var/www/html/web2py/handlers/wsgihandler.py /var/www/html/web2py/wsgihandler.py
chmod 755 /var/www/html/web2py
chown -R apache:apache /var/www/html/web2py
@grenade
grenade / Install-GitList
Last active December 21, 2015 14:09
Installing GitList on Fedora / RedHat
sudo yum install php-phpunit-PHPUnit
# sudo yum install php-pear
# sudo pear channel-discover pear.phpunit.de
# sudo pear install --alldeps phpunit/PHPUnit
GIT_DIR=/data/git/repositories
WWW_DIR=/data/www/html/gitlist
sudo git clone http://github.com/klaussilveira/gitlist.git $WWW_DIR
# cd $WWW_DIR/../ && sudo tar -zxvf gitlist-master.tar.gz gitlist/vendor
@grenade
grenade / install-gitolite.sh
Last active July 29, 2020 19:33
Install Gitolite and grant yourself access on Fedora / RedHat
# create git user and ssh keys
sudo adduser --system --create-home --shell /bin/bash --comment 'git version control' git
sudo su - git -c 'mkdir -m=700 ~/.ssh'
sudo su - git -c 'ssh-keygen -t rsa -C "git@$(hostname)" -N "" -f ~/.ssh/id_rsa'
sudo su - git -c 'chmod 600 ~/.ssh/id_rsa'
sudo su - git -c 'chmod 644 ~/.ssh/id_rsa.pub'
# install gitolite, set umask and run setup
sudo yum install -y gitolite
sudo sed -i 's/0077/0007/g' /usr/share/gitolite/conf/example.gitolite.rc
@grenade
grenade / Install-PyGit2
Created August 23, 2013 10:35
Build and install pygit2 (with libgit2) on Fedora / RedHat
sudo yum install cmake openssl-devel pyOpenSSL http-parser-devel python-http-parser
git clone -b master https://github.com/libgit2/libgit2.git ~/git/github.com/libgit2/libgit2
mkdir ~/git/github.com/libgit2/libgit2/build
cd ~/git/github.com/libgit2/libgit2/build
cmake ..
cmake --build .
sudo cmake --build . --target install
git clone https://github.com/libgit2/pygit2.git ~/git/github.com/libgit2/pygit2
cd ~/git/github.com/libgit2/pygit2
export LIBGIT2="/usr/local"
@grenade
grenade / create-users.sh
Last active April 16, 2018 16:23
Create multiple new user accounts on Linux, set passwords to match usernames, force password change at first login and add users to some-user-group.
for username in foo bar baz qux
do
/usr/sbin/useradd $username
echo $username | passwd $username --stdin
chage -d 0 $username
/usr/sbin/usermod -a -G some-user-group $username
done
@grenade
grenade / ldap-user-info.py
Created August 23, 2013 10:42
Lookup user attributes in LDAP with Python
def user_info(username):
#todo: move these parameters to config
ldap_host = 'example.com'
ldap_port = 389
ldap_base_dn = 'OU=DK,DC=example,DC=com'
ldap_bind_dn = 'CN=<removed>,OU=DK,DC=example,DC=com'
ldap_bind_pw = '<removed>'
ldap_attr_uid = 'sAMAccountName'
ldap_attr_forename = 'givenName'
ldap_attr_surname = 'sn'
@grenade
grenade / restart-oracle-xe.sh
Created August 23, 2013 11:16
Database shutdown and restart for Oracle XE
sqlplus / as sysdba <<EOF
shutdown immediate
startup mount
alter database open;
shutdown immediate
startup
EOF
cat >/etc/profile.d/git.sh <<'EOF'
source /usr/share/git-core/contrib/completion/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export PS1='\[\033[00;36m\]\u@\h\[\033[00m\]:\[\033[01;34m\] \w\[\033[00m\]$(__git_ps1 " (%s)")\$ '
EOF
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active November 9, 2024 20:40
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh keys
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>"
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <[email protected]>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network