Skip to content

Instantly share code, notes, and snippets.

@plentz
plentz / nginx.conf
Last active July 22, 2024 11:19
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# You can get cmudict, a phonetic dictionary of english used for speech recognition purposes, here: http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict.0.7a
entries = File.open('/Users/ted/data/cmudict.0.7a.txt').read.split("\n"); ''
dict = entries.map{ |e| e.split }.reject{ |e| e.first =~ /^;;;/}; ''
results = dict.map do |entry|
char_count = entry.first.size
phonemes = entry.slice(1,entry.size)
phonemes.select{ |p| p =~ /\d/ }.size == 4 ? [entry, char_count] : nil;
end.compact.sort_by{ |e| e.last }; results.size
@knowtheory
knowtheory / google_docs_scraper.js
Created January 13, 2015 14:53
Google Drive has an in document javascript API which allows you to do powerful and crazy things like build a web scraper that runs on a timer. When in a google spreadsheet, go to the tools menu and select "script editor".
// Fetch and append the current temperature
function fetchAndAppendWeather() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getActiveSheet();
// All the actual work is done in the top row.
// We get the link stored in cell A1 (say http://www.wunderground.com/cgi-bin/findweather/getForecast?query=02217 )
var weatherLink = sheet.getRange("A1").getValue();
// we set a formula importing a targeted portion of the web page
@dust321
dust321 / arch-linux-install-encryption
Last active April 2, 2021 23:43 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing Arch Linux on an DOS/BIOS system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system, for BIOS. Dustin dut n ex 5 a t g ma il
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
@hashhar
hashhar / _aurvote
Last active July 4, 2017 15:21
Bash Completion Scripts
# Written: Ashhar Hasan (hashhar_dev at outlook dot com) on 13 April 2017
_cache_file="${XDG_CACHE_HOME:=~/.cache}/aurvote/packages.gz"
# If cache file is older than a week or doesn't exist yet, update it.
_setup_cache()
{
local last_update=1
[ -e "${_cache_file}" ] && last_update=$(stat -c %Y "${_cache_file}")
# Compare the epoch times of existing file and current date.
@GAS85
GAS85 / split_tunnel_VPN.md
Last active June 20, 2024 14:30
Force Torrent/user Traffic through VPN Split Tunnel on Ubuntu 16.04
#!/usr/bin/python
'''
# Exploit Title: LibreNMS v1.46 authenticated Remote Code Execution
# Date: 24/12/2018
# Exploit Author: Askar (@mohammadaskar2)
# CVE : CVE-2018-20434
# Vendor Homepage: https://www.librenms.org/
# Version: v1.46
# Tested on: Ubuntu 18.04 / PHP 7.2.10
@lmlsna
lmlsna / setup-ssh-via-tor.sh
Last active September 2, 2019 01:18
Setup a tor hidden service for SSH
#!/bin/bash
# Set hidden service directory
#
hsdir=/var/lib/tor/sshd
# Add hidden service config to /etc/tor/torrc
#
cat >> /tmp/test << __TOR_CONFIG__
HiddenServiceDir $hsdir
@mala
mala / CVE-2019-5418_is_RCE.md
Last active February 7, 2021 04:25
Rails の CVE-2019-5418 は RCE (Remote code execution) です
@rjhansen
rjhansen / keyservers.md
Last active April 14, 2024 12:28
SKS Keyserver Network Under Attack

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?