Skip to content

Instantly share code, notes, and snippets.

@seyDoggy
seyDoggy / responsive-sticky-footer.css
Last active November 30, 2017 03:04
Responsive sticky footer for bootstrap
@martinseener
martinseener / shellshock_patcher_sh
Last active August 29, 2015 14:06
Shellshock Bash Patcher for Debian/Ubuntu (Rundeck-compatible)
#!/bin/bash
env x='() { :;}; echo vulnerable' bash -c "echo this is a test" | grep vulnerable > /dev/null 2>&1
if [ $? -eq 1 ]; then
echo "Not vulnerable. Machine is safe."
exit 0
else
echo -n "Vulnerable. Version: "
/bin/bash --version
echo "Installing patch."
@k-popov
k-popov / check_node_old.sh
Created December 24, 2013 15:53
Tiny script that looks for CI nodes and outputs their uptime in minutes It's unable to cope with nodes running more than an day (separate output) and those which run less than hour (0 is printed)
#!/bin/bash
check_node() {
local ID="$1"
local NODE="$2"
UPTIME_LINE="$(ssh -q -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null $NODE uptime < /dev/null)"
if echo "${UPTIME_LINE}" | grep -q 'days'; then
echo "${ID}:${NODE}:OLDERTHANADAY"
return 0
fi
@k-popov
k-popov / m2_cleanup
Last active December 30, 2015 08:19
#!/bin/sh
M2DIR=~/.m2
MAXAGE="864000" # 10 days in sec
NOW="`date +%s`"
MAXOLD="$(($NOW - $MAXAGE))" # files older than this will be removed. See further
# get list or artifact ID's prependede with group
find $M2DIR -iname "*.pom" \
| xargs dirname | xargs dirname \ # dirname twice gives a directory 1 level up the version
| sort | uniq \
| while read ARTIFACT; do
@st4lk
st4lk / root_logger_settings.py
Last active May 2, 2024 15:25
Python logging settings for root logger
"""
Settings for root logger.
Log messages will be printed to console and also to log file (rotated, with
specified size). All log messages from used libraries will be also handled.
Three approaches for defining logging settings are used:
1. using logging classes directly (py25+, py30+)
2. using fileConfig (py26+, py30+)
3. using dictConfig (py27+, py32+)
Choose any variant as you like, but keep in mind python versions, that
@willurd
willurd / web-servers.md
Last active June 13, 2024 14:37
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kvandenhaute
kvandenhaute / nginx.conf
Created March 28, 2013 11:06
Example of a good working Nginx configuration.
user www-data;
# As a thumb rule: One per CPU. If you are serving a large amount
# of static files, which requires blocking disk reads, you may want
# to increase this from the number of cpu_cores available on your
# system.
#
# The maximum number of connections for Nginx is calculated by:
# max_clients = worker_processes * worker_connections
worker_processes 1;
include_recipe "apt"
include_recipe "python"
execute "upgrade packages" do
command "apt-get -y upgrade"
action :nothing
end.run_action(:run)
package 'vim'
package 'python-setuptools'
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@echristopherson
echristopherson / macvim.rb
Created November 19, 2012 03:54
macvim-with-breakindent-patch.rb
require 'formula'
class Macvim < Formula
homepage 'http://code.google.com/p/macvim/'
url 'https://github.com/b4winckler/macvim/tarball/snapshot-65'
version '7.3-65'
sha1 'fa5f6e0febe1ebcf5320a6ff8bcf4c7e39eccf8e'
head 'https://github.com/b4winckler/macvim.git', :branch => 'master'