Skip to content

Instantly share code, notes, and snippets.

@0xack13
0xack13 / Perl-SNMP-System-Uptime.pl
Last active October 9, 2015 07:28
Perl SNMP Sample
#! /usr/local/bin/perl
### To install Perl SNMP Module: perl -MCPAN -e shell ; "install SNMP"
use strict;
use warnings;
use Net::SNMP;
my $OID_sysUpTime = '1.3.6.1.2.1.1.3.0';
my ($session, $error) = Net::SNMP->session(
-hostname => shift || 'localhost',
@0xack13
0xack13 / javascript-select-text
Created December 1, 2012 23:08
Selected text alert in javascript
var range = window.getSelection().getRangeAt(0),
content = range.extractContents(),
span = document.createElement('SPAN');
span.appendChild(content);
var htmlContent = span.innerHTML;
range.insertNode(span);
alert(htmlContent);
@0xack13
0xack13 / gist:4185801
Created December 1, 2012 23:10
Highlight selected text without jquery
var selection = window.getSelection();
var range = selection.getRangeAt(0);
var newNode = document.createElement("span");
newNode.setAttribute("style", "background-color: pink;");
range.surroundContents(newNode);
@0xack13
0xack13 / Get-FolderSize.ps
Created July 24, 2014 20:45
Powershel Sort Directories by Size
# Get-ChildItem -Directory -Recurse -EA 0 | Get-FolderSize | sort size -Descending
Function Get-FolderSize
{
BEGIN{$fso = New-Object -comobject Scripting.FileSystemObject}
PROCESS{
$path = $input.fullname
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='//code.jquery.com/jquery-1.9.1.js'></script>
@0xack13
0xack13 / gitcommit-with-old-specific-date-on-Mac-OS-X.sh
Created August 11, 2015 09:55
git commit with old date "Mac OS X"
git commit --date="`date -v-3m +%Y-%m-%d`" -am "Initial commit since the past 3 months"
@0xack13
0xack13 / mac-write-NTFS
Created August 13, 2015 05:16
mac-write-NTFS
#vi /etc/fstab
LABEL=DRIVE_NAME none ntfs rw,auto,nobrowse
@0xack13
0xack13 / log.sh
Created May 5, 2020 12:32
Passwordless Sudo
sudo visudo
sudo update-alternatives --config editor
ALL ALL = (ALL) NOPASSWD: ALL

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps

  1. what is a parser?
  2. and.. what is a parser combinator?

So first question: What is parser?

@0xack13
0xack13 / bobp-python.md
Created September 30, 2020 02:29 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens