Skip to content

Instantly share code, notes, and snippets.

View neopunisher's full-sized avatar
🎯
Focusing

Carter Cole neopunisher

🎯
Focusing
View GitHub Profile
@leommoore
leommoore / linux_running_a_node_service_with_forever.md
Last active April 27, 2016 15:38
Linux - Running a Node Service (Forever)

#Linux - Running a Node Service (Forever) This is based on the excellent post at http://www.exratione.com/2013/02/nodejs-and-forever-as-a-service-simple-upstart-and-init-scripts-for-ubuntu/.

Forever is a useful tool for running a Node.js process with monitoring; it can be set to restart a failed process, and has a few other helpful features along the same lines. In this post you'll find a couple of exceedingly simple scripts for running a Node.js process as a service on Ubuntu using Forever.

##Install Forever Forever must be installed globally.

npm -g install forever
@neopunisher
neopunisher / enablePhpShortTags.sh
Last active December 18, 2015 12:48
Does an inline replace to enable php short tags (<?)
sed -i 's/short_open_tag = Off/short_open_tag = On/g' /etc/php.ini
grep -n short_open_tag /etc/php.ini
/sbin/service httpd restart
@bcap
bcap / terminal-control.sh
Last active March 29, 2024 14:02
Useful terminal control characters
# Terminal output control (http://www.termsys.demon.co.uk/vtansi.htm)
TC='\e['
CLR_LINE_START="${TC}1K"
CLR_LINE_END="${TC}K"
CLR_LINE="${TC}2K"
# Hope no terminal is greater than 1k columns
RESET_LINE="${CLR_LINE}${TC}1000D"
@neopunisher
neopunisher / getnode.sh
Last active December 17, 2015 02:08
get the 64 bit version of node 0.9.9
cd /usr/local/src/
wget http://nodejs.org/dist/v0.9.9/node-v0.9.9-linux-x64.tar.gz
tar zxvf node-v0.9.9-linux-x64.tar.gz
cd node-v0.9.9-linux-x64
ln -s /usr/local/src/node-v0.9.9-linux-x64/bin/node /usr/local/bin/node
ln -s /usr/local/src/node-v0.9.9-linux-x64/bin/npm /usr/local/bin/npm
ln -s /usr/local/src/node-v0.9.9-linux-x64/bin/node /usr/bin
@justincarroll
justincarroll / bootstrap-basic-template.htm
Last active May 11, 2018 04:43
This is my personal Bootstrap 3 and Font Awesome 4 basic HTML template.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Basic Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
@neopunisher
neopunisher / redactFackbook.js
Last active November 26, 2016 04:18
Redact Facebook names
function b(){[].forEach.call(document.querySelectorAll(".UFICommentActorName,.fwb a[data-hovercard]"),function(a){a.innerText=a.innerText.replace(/./gi,"\u2588");a.style.color="black"});[].forEach.call(document.querySelectorAll(".UFIActorImage,img._s0.img"),function(a){a.src=a.alt="";a.style.backgroundColor="black"})}var c=window;c.addEventListener?c.addEventListener("scroll",b,!1):c.attachEvent&&c.attachEvent("onscroll",b);b();
@neopunisher
neopunisher / curl_httpheaders.php
Last active October 3, 2017 14:45
Parse the http headers that curl returns raw
<?
$sUrl = 'http://cartercole.com';
$oCurlConnection = curl_init();
curl_setopt($oCurlConnection, CURLOPT_FAILONERROR, true); // If error code found, fail connection
curl_setopt($oCurlConnection, CURLOPT_URL,$sUrl); // Url to request
//curl_setopt($oCurlConnection, CURLOPT_USERAGENT, $sUserAgent); // User Agent of request
curl_setopt($oCurlConnection, CURLOPT_CONNECTTIMEOUT, 30); // Time out for a single connection
@neopunisher
neopunisher / injectUnderscore.js
Created February 6, 2013 15:22
Injects the underscore library into the page
(function(){var a=document.createElement("script");a.type="text/javascript";a.src="http://bit.ly/latestUnderscore";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)})();
@max-mapper
max-mapper / readme.md
Last active June 3, 2020 00:31
automatically scan for and join open internet enabled wifi networks on linux using node.js (tested on raspberry pi raspbian)
@neopunisher
neopunisher / cento-sius.sh
Last active October 12, 2015 21:39
Setup a centos with ius
# to autorun: curl -L http://j.mp/iusinstall | sh
ask4 () {
echo -n "$1 [Y]es/[N]o? "
read answer
finish="-1"
while [ "$finish" = '-1' ]
do
finish="1"
if [ "$answer" = '' ];