Skip to content

Instantly share code, notes, and snippets.

View flesler's full-sized avatar

Ariel Flesler flesler

View GitHub Profile
@nicholasadamou
nicholasadamou / setup_kali-pi.md
Created April 22, 2018 13:51
How to setup & configure re4son-Kali-Pi on Raspberry Pi 2/3

Setup Re4son-Kali-Pi on Raspberry Pi 2/3

  1. Download and image sticky-fingers-re4son-image to the Pi.
  2. Copy the following scripts: update apt_update apt_get_update aptitude_update to /usr/local/bin
  3. Copy the following scripts: start_tightvncserver.sh start_x11vncserver.sh to /root/data/
  4. copy the following the contents of : Backgrounds/ to ~/Backgrounds
  5. Set up WiFi connection to 'iPhone' using HDMI Screen
  6. remove tigervnc using: apt-get remove tigervnc-common tigervnc-standalone-server
  7. Setup re4son kernel:
@Pitasi
Pitasi / check_telegram_signature.js
Last active March 12, 2024 15:06
Telegram website login widget, signature check sample using Node.js
// Copied by https://gist.github.com/dotcypress/8fd12d6e886cd74bba8f1aa8dbd346aa,
// thanks for improving code style
const { createHash, createHmac } = require('crypto');
const TOKEN = "ABC:12345...";
// I prefer get the secret's hash once but check the gist linked
// on line 1 if you prefer passing the bot token as a param
const secret = createHash('sha256')
.update(TOKEN)
@kuznero
kuznero / vdi-file-compacting.md
Last active March 22, 2024 22:49
How to compact VirtualBox's VDI file size?

Source: StackOverflow

1. Run defrag in the guest (Windows only)

2. Nullify free space:

With a Linux Guest run this:

sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active April 12, 2024 14:50
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@flesler
flesler / generate-pass.html
Last active October 30, 2015 14:03
Bookmarklet to generate deterministic passwords based on a service name
<p>Minified and ready to be dragged to bookmarks toolbar<br />
Remember to customize the 4 parameters at the end</p>
<a href="javascript:(function(c,f,g,e){var a=location.hostname.split('.');do var b=a.pop();while(a.length&&3>=b.length);this._custom_?b=prompt('Write the service name',b):this._custom_=!0;var a=b,d;for(d in e)a=a.replace(new RegExp(d,'i'),e[d]);a=a.replace(/[a-z]/,function(a){return a.toUpperCase()});a=f+a;a+=g.slice(-(c-a.length));a=a.slice(0,c);alert('Service:'+b+'\nPassword:'+a)})(10,'Gp','_T8e.P2j!',{i:'!',a:'@',s:'$',l:1,z:2,e:3,g:6,t:7,b:8,o:0});">
Generate Pass
</a>
<p>Uncompressed source code</p>
<pre>
(function(length, prefix, suffix, map) {
/* 1.0 */
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@flesler
flesler / index.html
Last active September 11, 2021 13:16
Anchor navigation powered by jquery.scrollTo
<!-- Include jQuery from somewhere, must use version 1.8 or above -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include latest jquery.scrollTo, can download from https://github.com/flesler/jquery.scrollTo/releases -->
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.scrollto/2.1.2/jquery.scrollTo.min.js"></script>
<!-- Initialize the plugin, the contents of the script can be inlined here, of course -->
<script type="text/javascript" src="js/init.js"></script>
@jdx
jdx / boot.js
Last active March 16, 2023 18:08
zero-downtime node.js app runner
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
@sindresorhus
sindresorhus / post-merge
Last active February 14, 2024 06:20
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"