Skip to content

Instantly share code, notes, and snippets.

View adamsdesk's full-sized avatar

Adam adamsdesk

View GitHub Profile
@adamsdesk
adamsdesk / getopts.sh
Created August 25, 2016 13:30
BASH getopts example
#!/bin/bash
if (($# == 0)); then
echo "`basename $0`: You must specify one of the '-hlrv' options."
echo "Try '`basename $0` -h' for more information."
exit 1
fi
while getopts ":hlr" opt; do
case $opt in
@adamsdesk
adamsdesk / gtkradiant.md
Last active May 11, 2016 02:18
How to Install GtkRadiant for Debian (Jessie 64-bit).
@adamsdesk
adamsdesk / urt-install.md
Last active April 29, 2016 02:54
How to install Urban Terror (64-bit) on Debian (Jessie).

How to Install UrbanTerror in Debian

System Dependencies

  1. libqt4-network:amd64

Download

  1. Browse to http://www.urbanterror.info/downloads/.
  2. Under "Game installer/updater" click on the "UrbanTerror42.tar.gz" link.
@adamsdesk
adamsdesk / gnome-rotate-wallpaper.service
Last active February 6, 2018 13:35
Rotate the Gnome desktop wallpaper using Systemd user unit and timer.
[Unit]
Description=Gnome rotate wallpaper
[Service]
Type=oneshot
Environment=DISPLAY=:0
Environment=WALLPAPER_DIR=%h/Pictures/wallpaper
EnvironmentFile=-%h/.config/systemd/user/gnome-rotate-wallpaper.conf
ExecStart=/bin/bash /usr/local/bin/gnome_rotate_wallpaper
@adamsdesk
adamsdesk / minecraft.service
Last active February 26, 2016 03:18
Minecraft Systemd service unit file. Used to run Minecraft server as a daemon and control it with mcrcon.
[Unit]
Description=Minecraft Server
Wants=network.target
After=network.target
[Service]
User=minecraft
Group=minecraft
Nice=5
SuccessExitStatus=0 1 143 255
@adamsdesk
adamsdesk / instructions.md
Last active December 31, 2015 04:00
How to create a Gnome menu shortcut so you can lancuh Minecraft client propperly within Linux. This was tested using Gnome v3.14 on Debian Jessie. Thanks goes to Kevin Flyn (http://www.deviantart.com/art/Minecraft-icon-364993975) for the creation of the Minecraft icon.
@adamsdesk
adamsdesk / status-email-send@.service
Last active February 1, 2016 15:47
Urban Terror Systemd service unit file. Used to run Urban Terror server as a daemon. Sends a notification on failure to a desired email address.
[Unit]
Description=status email for %i to notify
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/systemd-email notify@example.com %i
User=root
Group=systemd-journal
#!/bin/bash
# Copyright (c) 2005 nixCraft project <http://cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# Source: http://www.cyberciti.biz/tips/move-mysql-users-privileges-grants-from-one-host-to-new-host.html
# Author Vivek Gite <vivek@nixcraft.com>,
# Peter Geil <code@petergeil.name>
# ------------------------------------------------------------
# SETME First - local mysql user/pass
_lusr="src-db-user"
_lpass="src-db-pw"
@adamsdesk
adamsdesk / gist:5062cb550b5f7274ebaf
Last active August 29, 2015 14:19
CakePHP v2.x configuration for Nginx.
server {
listen 80;
server_name foo;
# root directive should be global
root /var/www/sites/foo/cpanel/webroot/;
index index.php;
access_log /var/log/nginx/access.foo.log;
error_log /var/log/nginx/error.foo.log;
server {
listen 80;
server_name thewarden;
# root directive should be global
root /var/www/sites/thewarden;
index index.php;
autoindex on;