Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh
The swap-window command is closest to what you want.
"Prefix :" (that is "Ctrl-B :" by default) brings you to the tmux-command prompt. There you enter:
swap-window -s 3 -t 1
to let window number 3 and window number 1 swap their positions.
To swap the current window with the top window, do:
swap-window -t 0
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
@mndambuki
mndambuki / PDO PHP Class
Last active September 16, 2015 07:52 — forked from geoffreyhale/PDO PHP Class
Roll Your Own PDO PHP Class
<?php
/**
* http://culttt.com/2012/10/01/roll-your-own-pdo-php-class/
*/
?>
@mndambuki
mndambuki / class.database.php
Last active September 16, 2015 07:52 — forked from vincentwansink/class.database.php
Database class based on Philip Brown's tutorial at http://culttt.com/2012/10/01/roll-your-own-pdo-php-class/
<?php
// Define database configuration
define("DB_HOST", $dblocation);
define("DB_USER", $dbusername);
define("DB_PASS", $dbpassword);
define("DB_NAME", $dbname);
class Database{
private $host = DB_HOST;
@mndambuki
mndambuki / eloquent-cheatsheet.php
Created April 25, 2016 07:23 — forked from hassansin/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/
@mndambuki
mndambuki / setup.sh
Last active May 26, 2016 08:05 — forked from integrii/setup.sh
uTorrent Server (utserver) on Centos 7 (x86_64)
#!/bin/bash
# Took me awhile to figure out how to install utserver on Centos 7 x86_64... Especially with the new systemd subsystem. None of the builds I saw support it - but it will work with a couple symlinks and compatibility packages.
yum install glibc libgcc openssl krb5-libs libcom_err zlib keyutils-libs libselinux glibc glibc.i[36]86 libgcc libgcc.i[36]86 openssl openssl.i[36]86 krb5-libs krb5-libs.i[36]86 libcom_err libcom_err.i[36]86 zlib zlib.i[36]86 keyutils-libs keyutils-libs.i[36]86 libselinux libselinux.i[36]86 openssl098e-0.9.8e-29.el7.centos.2.i686 -y
ln -s /usr/lib/libssl.so.0.9.8e /lib/libssl.so.0.9.8
ln -s /usr/lib/libcrypto.so.0.9.8e /lib/libcrypto.so.0.9.8
mkdir /var/utserver
wget -O /var/utserver/utorrent-server-3.0-25053.tar.gz http://download.utorrent.com/linux/utorrent-server-3.0-25053.tar.gz
cd /var/utserver/
tar zxf utorrent-server-3.0-25053.tar.gz
mv /var/utserver/utorrent-server-v3_0/* /var/utserver/
@mndambuki
mndambuki / sysctl.conf
Created June 11, 2017 05:21 — forked from rschmitty/sysctl.conf
ubuntu sysctl.conf settings
# changes from http://www.cyberciti.biz/faq/linux-kernel-etcsysctl-conf-security-hardening/
# Protect ICMP attacks
net.ipv4.icmp_echo_ignore_broadcasts = 1
# Turn on protection for bad icmp error messages
net.ipv4.icmp_ignore_bogus_error_responses = 1
# Turn on syncookies for SYN flood attack protection
net.ipv4.tcp_syncookies = 1
@mndambuki
mndambuki / blocksync.py
Created June 29, 2017 22:37 — forked from geraldh/blocksync.py
Block device sync between remote hosts. Based off http://www.bouncybouncy.net/programs/blocksync.py
#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <[email protected]>
Copyright 2011 Robert Coup <[email protected]>
License: GPL
Getting started:
@mndambuki
mndambuki / blocksync.py
Created June 29, 2017 22:37 — forked from rcoup/blocksync.py
Block device sync between remote hosts. Based off http://www.bouncybouncy.net/programs/blocksync.py
#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <[email protected]>
Copyright 2011 Robert Coup <[email protected]>
License: GPL
Getting started: