Skip to content

Instantly share code, notes, and snippets.

View deanet's full-sized avatar
:octocat:
talk is cheap, show me the code

deanetdavid deanet

:octocat:
talk is cheap, show me the code
View GitHub Profile
@deanet
deanet / openbsd.pf
Created February 18, 2014 11:15
openbsd simple NAT internet gateway
ext_if = "rl0" # macro for external interface - use tun0 for PPPoE
int_if = "bge0" # macro for internal interface
int_net = "192.168.2.0/24"
pass out on $ext_if from $int_if:network to any nat-to ($ext_if)
@deanet
deanet / pass.sh
Last active September 5, 2023 04:04
Bash Password Manager with OpenSSL aes-256
#!/bin/bash
trap ctrl_c INT
function ctrl_c() {
echo "** WARNING HIT CTRL^C MAKE LOSS YOUR pass.enc File **"
}
file="pass.txt"
@deanet
deanet / more-agent.vcl
Last active December 30, 2015 15:59
allow google bot to crawl on varnish
sub vcl_recv {
#taken from http://www.useragentstring.com/pages/useragentstring.php
if (req.http.user-agent ~ "008") {
return (pass);
}
if (req.http.user-agent ~ "ABACHOBot") {
return (pass);
}
@deanet
deanet / domainredirect.rb
Created August 29, 2013 05:43
domain redirect Ror
module Rack
# Automatically redirects to the configurable domain
#
# If request comes from other than specified domains it redirects to the first
# domain from the list
class DomainRedirect
def initialize(app, hosts = [])
@app = app
@deanet
deanet / read.me
Last active December 19, 2015 16:18
- Works for Airtime v.2.3.1 and for Airtime v.2.4.0 supported AAC+ as defaults. just need extra config (https://wiki.sourcefabric.org/x/NgPQ) .
root@cpalstream:~# su - postgres
postgres@cpalstream:~$ psql -c "update cc_pref set valstr = valstr||', fdkaac' where keystr = 'stream_type'" airtimeUPDATE 1
postgres@cpalstream:~$
- Make sure our liquidsoap works with aacp encode as well (apt-get install libaacplus-dev:amd64 libaacplus-ocaml libaacplus-ocaml-dev or see https://gist.github.com/deanet/5982456 for more installation of airtime v.2.3.1)
- live works:
@deanet
deanet / localgen.pl
Created July 12, 2013 06:56
log Installation airtime v.2.3.1- autodj mp3 .
#!/usr/bin/perl -w
#set-debian-locales-utf8.pl
sub exec_ok($$);
use strict;
use warnings;
if (! ( `debconf-show locales` =~ m/locales\/ default_environment_locale: en_US.UTF-8/ ) ) {
@deanet
deanet / ssh.sh
Created July 11, 2013 11:42
multiport-ssh
deanet@husaini ~ $ ssh [email protected] -v
OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011
debug1: Reading configuration data /home/deanet/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 116.251.208.13 [116.251.208.13] port 22.
debug1: Connection established.
debug1: identity file /home/deanet/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
#example vhost protect wp-login.php at nginx php-fpm
upstream arraudhah {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name ar-raudhah.info www.ar-raudhah.info;
server_name_in_redirect off;
@deanet
deanet / append_to.rb
Created October 12, 2012 22:43
redirect spree url
config.autoload_paths += %W(#{config.root}/lib)
config.middleware.use "NoWww", ['pasarcairo.com', '192.168.0.177']
<?php
phpinfo();
?>