Skip to content

Instantly share code, notes, and snippets.

@statik
statik / gist:981961
Created May 19, 2011 22:34 — forked from jtimberman/gist:548261
preseed.cfg for automated installations with chef from apt.opscode.com
# This is the entire preseed config file used on an example Lucid system. See the preseed
# documentation for more information on the options here. This will use US English by default.
#
# https://help.ubuntu.com/10.04/installation-guide/amd64/preseed-contents.html
#
# This preseed will automatically install Ubuntu 10.04 with default options. Understand what
# it is doing before you use it.
#
# Boot Options line:
#
@mattd
mattd / gist:1006398
Created June 3, 2011 14:12
nginx try_files with a proxy_pass
server {
root /var/www/example.com/static;
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
try_files /maintenance.html @proxy;
location @proxy {
proxy_pass http://127.0.0.1:10001;
@marvin
marvin / gist:1017480
Created June 9, 2011 19:16
syslog calculate facility and severity from PRI(priority)
example:
PRI = 191
To get the Facility
Divide the PRI number by 8.
191/8 = 23.875
The whole number part is the facility.
To get the Severity
@atuttle
atuttle / leeroy.cfg
Created October 20, 2011 15:02
This is my preseed file for auto-installing Ubuntu 11.04 on my Jenkins server
#### Contents of the preconfiguration file (for squeeze)
### Localization
# Preseeding only locale sets language, country and locale.
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.
#d-i localechooser/supported-locales en_US.UTF-8, nl_NL.UTF-8
d-i debian-installer/locale string en_US
@jrom
jrom / nginx.conf
Created February 7, 2012 17:14
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@medigeek
medigeek / pamtest.py
Created February 22, 2012 00:47
Idea for timekpr
#!/usr/bin/python
# sudo ./pamtest.py <username>
# If your run this as root, you don't need authentication.
# Perfect for True or False (if user is allowed to login or not)
import sys
import PAM
from getpass import getpass
def pam_conv(auth, query_list, userData):
@proudlygeek
proudlygeek / oneliners.sh
Last active September 27, 2019 16:51
Bash one liners
##### GIT
# Removes all local branch
for branch in $(git branch | grep "feature/MAGENTA-"); do git branch -D $branch; done
# Remove all new files
for file in $(git status | grep "new file" | sed "s/#\tnew file://"); do git rm --cached $file; done
# Delete all remote branches
for remote_branch in $(git ls-remote); do if [[ $remote_branch =~ .*(feature/MAGENTA-([0-9|^130]).+).* ]]; then git push origin :${BASH_REMATCH[1]}; fi; done
@timnew
timnew / Rename.ps1
Last active June 10, 2024 13:08
Script to Rename Computer without Reboot
$ComputerName = "New Name"
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname"
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname"
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\Computername" -name "Computername" -value $ComputerName
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername" -name "Computername" -value $ComputerName
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" -value $ComputerName
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" -value $ComputerName
Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -name "AltDefaultDomainName" -value $ComputerName
@vsergeev
vsergeev / beagle_elfs.md
Created April 15, 2012 09:45
Minimalist "Embedded Linux from Scratch" Beaglebone Distribution Build

Busybox "Embedded Linux from Scratch" Distribution for the Beaglebone

Prepare your Build Sandbox

$ mkdir -p beaglelfs/{sources,rootfs_install,boot_mnt,rootfs_mnt}

Acquire an ARM Toolchain

Download the latest i686 Binary TAR of the ARM GNU/Linux (glibc-based) Lite Toolchain:

@masak
masak / explanation.md
Last active June 18, 2024 08:24
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.