Skip to content

Instantly share code, notes, and snippets.

@linickx
linickx / gist:1002110
Created June 1, 2011 10:56
find some large-ish files
#!/bin/bash
find / -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
@linickx
linickx / JunOS-Default
Created July 18, 2011 17:25
JunOS SRX Default Configuration
## Last commit: 2011-07-07 17:54:33 UTC by root
version 10.3R1.9;
system {
autoinstallation {
@linickx
linickx / gist:1107884
Created July 26, 2011 20:11
OpenSift $_SERVER Variables
Array
(
[HTTP_HOST] => secretkey-linickx.rhcloud.com
[HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X ) AppleWebKit/ (KHTML, like Gecko) Chrome/ Safari/
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
[HTTP_ACCEPT_ENCODING] => gzip,deflate,sdch
[HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.8
[HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.3
[HTTP_X_FORWARDED_FOR] => x
[HTTP_X_FORWARDED_HOST] => secretkey-linickx.rhcloud.com
@linickx
linickx / admin-options_dbblock.php
Created August 19, 2011 14:49
PRT - admin options - dbblock
<?php
// Line 36
# How do we connect to phpbb?
if ($lnx_PRT_options['prt_phpbb_dbinsecureon'] != "1") {
# COnnect to phpBB and get a list of forums
$wpdb->select($lnx_PRT_options['prt_phpbb_db']);
# Run The query
$tt_results = $wpdb->get_results("SELECT * FROM $lnx_PRT_options[prt_phpbb_tt] LIMIT 3"); // Topic Table Querey - check connectivity
@linickx
linickx / cidr2mask.php
Created October 24, 2011 16:04
php network functions
<?php
function cidr2mask($netmask) {
$netmask_result="";
for($i=1; $i <= $netmask; $i++) {
$netmask_result .= "1";
}
for($i=$netmask+1; $i <= 32; $i++) {
@linickx
linickx / cli_input.php
Created January 20, 2012 16:57
Command Line PHP, Shell input $1
<?php
# Print all the arguments from CLI
print_r($_SERVER['argv']);
# The first argument $_SERVER['argv'][0] is always the name that was used to run the script.
# Reference: http://php.net/manual/en/reserved.variables.argv.php
echo $_SERVER['argv'][0];
@linickx
linickx / gist:3692156
Created September 10, 2012 17:01
hubot init script for RHEL / CENTOS
#!/bin/bash
# hubot
# chkconfig: 345 20 80
# description: hubot
# processname: hubot
# REFERENCE: http://werxltd.com/wp/2012/01/05/simple-init-d-script-template/
# This script assumes you have a user called "hubot" on your system and that hubot is installed in /opt/hubot
@linickx
linickx / brew doctor
Created February 21, 2013 20:24
mediatomb fails to build on OSX 10.8.2
NickelMac:~ nick$ brew doctor
Your system is raring to brew.
NickelMac:~ nick$
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... configure_aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-apple-darwin12.2.0
checking host system type... x86_64-apple-darwin12.2.0
@linickx
linickx / 01.config
Created March 11, 2013 16:49
build results for mediatomb with dependencies
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... configure_aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-apple-darwin12.2.0
checking host system type... x86_64-apple-darwin12.2.0