Skip to content

Instantly share code, notes, and snippets.

View jnovack's full-sized avatar
😠
Changing tabs to spaces...

Justin J. Novack jnovack

😠
Changing tabs to spaces...
View GitHub Profile
@goncha
goncha / jquery-flot.html
Last active December 16, 2015 07:59
jQuery Flot query Graphite data
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"></meta>
<title>Graphite Flot Example</title>
<style type="text/css">
#graphite {
width: 300px;
height: 200px;
font-size: 14px;
@netsuite
netsuite / findById.js
Created April 17, 2013 22:16
ss: findById / findByName
function findById(source, id) {
for (var i = 0; i < source.length; i++) {
if (source[i].name === id) {
return source[i];
}
}
throw "Couldn't find object with id: " + id;
}
@wankdanker
wankdanker / broadcast.js
Created November 2, 2011 18:51
simple test cases for broadcast and multicast compatibility between node.js v0.4.x and v0.6.x
var dgram = require('dgram');
var socket = dgram.createSocket('udp4');
var testMessage = "[hello world] pid: " + process.pid;
var broadcastAddress = '255.255.255.255';
var broadcastPort = 5555;
socket.setBroadcast(true);
socket.bind(broadcastPort, '0.0.0.0');
global
log logstash local0 #Change logstash to your naming
log-send-hostname
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
maxconn 4000
defaults
@pando85
pando85 / rsyslog_elasticsearch_docker.conf
Last active February 24, 2021 03:37
rsyslog configuration omelasticsearch with docker
#Ignore logs kibana
#:syslogtag, isequal, "kibana:" stop
#Ignore daemon severity
#daemon.* stop
#Ignore facility cron
#cron.* stop
#Ignore logs elasticsearch
@RichardBronosky
RichardBronosky / nc.md
Created November 10, 2020 20:52 — forked from jtbonhomme/nc.md
Using Netcat for File Transfers

Netcat is like a swiss army knife for geeks. It can be used for just about anything involving TCP or UDP. One of its most practical uses is to transfer files. Non *nix people usually don't have SSH setup, and it is much faster to transfer stuff with netcat then setup SSH. netcat is just a single executable, and works across all platforms (Windows,Mac OS X, Linux).

Destination

On the receiving (destination) terminal, run:

nc -l -p 1234 > out.file 
@jnovack
jnovack / cisco-decrypt-type7-password.js
Last active July 20, 2021 17:38
Javascript function() to decrypt Type 7 passwords from Cisco
function crackPassword(password) {
var crypttext = password.toUpperCase();
var plaintext = '';
var xlate = "dsfd;kfoA,.iyewrkldJKDHSUBsgvca69834ncxv9873254k;fg87";
var seed, i, val = 0;
if(crypttext.length & 1)
return;
seed = (crypttext.charCodeAt(0) - 0x30) * 10 + crypttext.charCodeAt(1) - 0x30;

Stealing WiFi

/etc/hosts

This will let you access any google owned site. This includes: youtube, google cache, google translate, google search, gmail, google news, etc.

  • Install the HTTPS Everywhere extension
  • Add these rules to your /etc/hosts file
@aputs
aputs / logrotate-nginx
Created June 12, 2010 03:04
logrotate config for nginx
/var/log/nginx_*.log {
daily
compress
delaycompress
rotate 2
missingok
nocreate
sharedscripts
postrotate
test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid`
@shrayasr
shrayasr / OLD_OLD_OLD_install_tmux_osx_no_brew.html
Last active July 17, 2023 14:45
[OBSOLETE] Install tmux on OSX WITHOUT brew
# Create a directory
mkdir ~/tmux-install
cd ~/tmux-install
# Get the files
curl -OL http://downloads.sourceforge.net/tmux/tmux-1.5.tar.gz
curl -OL http://downloads.sourceforge.net/project/levent/libevent/libevent-2.0/libevent-2.0.16-stable.tar.gz
# Extract them
tar xzf tmux-1.5.tar.gz