Skip to content

Instantly share code, notes, and snippets.

chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
chmod 644 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/github_rsa
chmod 644 ~/.ssh/github_rsa.pub
chmod 600 ~/.ssh/mozilla_rsa
chmod 644 ~/.ssh/mozilla_rsa.pub
@wozzup
wozzup / Math.php
Created February 26, 2017 09:31 — forked from jgrossi/Math.php
Math class from Taylor Otwell. Thanks to @brad (captain_jim1@yahoo.com) for the class content.
<?php
class Math {
/**
* The base.
*
* @var string
*/
private static $base = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
@wozzup
wozzup / .gitignore
Created December 12, 2016 03:05 — forked from olooney/.gitignore
worked examples of argparse and python logging
logs/
@wozzup
wozzup / myservice
Created May 31, 2016 14:57 — forked from bramus/myservice
Running a PHP script as a service/daemon using `start-stop-daemon`
#! /bin/sh
# Installation
# - Move this to /etc/init.d/myservice
# - chmod +x this
#
# Starting and stopping
# - Start: `service myservice start` or `/etc/init.d/myservice start`
# - Stop: `service myservice stop` or `/etc/init.d/myservice stop`
@wozzup
wozzup / longPolling.js
Created May 25, 2016 10:06 — forked from jasdeepkhalsa/longPolling.js
Simple Long Polling Example with JavaScript and jQuery by Tian Davis (@tiandavis) from Techoctave.com (http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery)
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast)
(function poll(){
$.ajax({ url: "server", success: function(data){
//Update your dashboard gauge
salesGauge.setValue(data.value);
}, dataType: "json", complete: poll, timeout: 30000 });
})();
@wozzup
wozzup / Process.class.php
Created May 16, 2016 13:36 — forked from keeguon/Process.class.php
A class to manage background processes (launch, kill, get status) in PHP.
<?php
class Process
{
protected
$command = '',
$outputFile = '',
$pidFile = ''
;
@wozzup
wozzup / thrifthelper.py
Created January 19, 2016 05:22 — forked from eungju/thrifthelper.py
Thrift HA
class ThriftConnection(object):
def __init__(self, service, host, port):
socket = TSocket.TSocket(host, port)
self.transport = TTransport.TFramedTransport(socket)
protocol = TBinaryProtocolAccelerated(self.transport)
self.client = service.Client(protocol)
self.transport.open()
self.open_time = time.time()
self.access_time = self.open_time
self.str = "%s#%d(%s:%d/%s)" % (self.__class__.__name__, id(self), host, port, service.__name__.rsplit(".", 1)[-1])
@wozzup
wozzup / osx-for-hackers.sh
Created January 18, 2016 06:45 — forked from matthewmueller/osx-for-hackers.sh
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@wozzup
wozzup / angularjs vs
Last active August 29, 2015 14:17 — forked from kentcdodds/README.md
#Hello World Characters of Code Comparison
##JavaScript
[Preview](http://embed.plnkr.co/blHgfEJV8y2yQcWZKRqo/preview)
Characters: 700
Lines of JavaScript: 13