Skip to content

Instantly share code, notes, and snippets.

View atmosx's full-sized avatar

Panagiotis Atmatzidis atmosx

View GitHub Profile
@pvalkone
pvalkone / gist:6147878
Created August 3, 2013 20:34
How to Install Tarsnap on Raspbian "Wheezy"
$ sudo aptitude install libssl-dev zlib1g-dev e2fslibs-dev debhelper libbz2-dev libattr1-dev libacl1-dev
$ wget https://www.tarsnap.com/download/tarsnap-autoconf-1.0.35.tgz
$ wget https://www.tarsnap.com/download/tarsnap-sigs-1.0.35.asc
$ gpg --decrypt tarsnap-sigs-1.0.35.asc
$ sha256sum tarsnap-autoconf-1.0.35.tgz
$ tar xzf tarsnap-autoconf-1.0.35.tgz
$ cd tarsnap-autoconf-1.0.35
$ ln -s pkg/debian .
$ dpkg-buildpackage
$ cd ..
@kymair
kymair / update-dns.py
Last active July 12, 2018 13:30
Python script to update Linode DNS
# Get Linode API python bindings from https://github.com/tjfontaine/linode-python
#!/usr/bin/python
from linode import api
instance = api.Api(key='abcdefg')
for domain in instance.domain_list():
if domain['TYPE'] == 'master':
print "Updating %s (%i)..." % (domain['DOMAIN'], domain['DOMAINID'])
@border
border / log.go
Created August 30, 2012 10:04
Log Example For Go
package utils
import (
"log"
"os"
)
var (
Log *log.Logger
)
@inferno
inferno / Rakefile
Created June 25, 2012 12:47
Rake task for show defined routes in Sinatra
desc 'List defined routes'
task 'routes' do
App::routes.each_pair do |method, list|
puts ":: #{method} ::"
routes = []
list.each do |item|
source = item[0].source
item[1].each do |s|
source.sub!(/\(.+?\)/, ':'+s)
@theladyjaye
theladyjaye / cmd.sh
Created October 18, 2013 21:06
clear salt minion cache
salt '*' cmd.run 'rm -rm /var/cache/salt/minion/files/base/*'
salt '*' saltutil.sync_all
@mohit
mohit / logstash_mongodb.rb
Created August 11, 2013 22:42
Parse MongoDB logs in logstash
filters {
grok {
type => "mongodb"
pattern => [ "%{DATA:mongo_ts} \[%{DATA:mongo_conn}\]? %{DATA:mongo_type} %{GREEDYDATA:mongo_message}" ]
}
mutate {
type => "mongodb"
replace => [ "@message", "%{mongo_message}" ]
}
grok {
@sivers
sivers / podcast.rb
Created October 29, 2019 21:30
Podcast RSS generator in Ruby
#!/usr/bin/env ruby
require 'date'
require 'xml'
def htmlit(infile)
lines = File.readlines(infile)
/<!--\s+(.+)\s+-->/.match lines.shift
lines.unshift('<h2>%s</h2>' % $1)
html = ''
lines.each do |line|
@konklone
konklone / Dockerfile
Created September 22, 2013 18:17
Dockerfile for installing Ruby 2.0 and RVM
FROM ubuntu
MAINTAINER Eric Mill "eric@konklone.com"
# turn on universe packages
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list
RUN apt-get update
# basics
RUN apt-get install -y nginx openssh-server git-core openssh-client curl
RUN apt-get install -y nano
@davewongillies
davewongillies / Terraform_functions.md
Last active July 15, 2023 14:41
Terraform Functions

Supported built-in functions

  • abs(float) - Returns the absolute value of a given float. Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. See also the signum function.

  • basename(path) - Returns the last element of a path.

  • base64decode(string) - Given a base64-encoded string, decodes it and returns the original string.

@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )