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 / screen.bash
Created May 7, 2012 09:06
download something when screensaver is active with xprintidle
#!/bin/bash
while [ 1 ];
do
if [ `xprintidle` -gt 300000 ];
then
pid=`gnome-screensaver-command -q | head -n 1 | awk '{print $4}'`
if [ "$pid" == "inactive" ];then
gnome-screensaver-command -l;
@deanet
deanet / google.sh
Created August 22, 2012 16:09
Uploading File into Google Drive (because grive too many dependencies qt, xorg ? )
#!/bin/bash
## uploading to google
## rev: 22 Aug 2012 16:07
det=`date +%F`
browser="Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1"
username="user@domain-apps.com"
password="password"
accountype="HOSTED" #gooApps = HOSTED , gmail=GOOGLE
<?php
phpinfo();
?>
@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']
#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 / ssh.sh
Created July 11, 2013 11:42
multiport-ssh
deanet@husaini ~ $ ssh root@116.251.208.13 -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
@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 / 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 / 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 / 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);
}