Skip to content

Instantly share code, notes, and snippets.

@mistic100
mistic100 / vimeo-downloader.js
Created September 15, 2018 09:01
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
@alexkharlamov
alexkharlamov / curl_pia.php
Created July 14, 2017 00:40
Scrape a website using Private Internet Access
$curl = curl_init();
$url = 'http://www.url_you_want_to_scrape.com';
$username = 'username'; // substitute your PIA PPTP/L2TP/SOCKS username (different from regular PIA username)
$password = 'password'; // substitute your PIA PPTP/L2TP/SOCKS password (different from regular PIA password)
$pia_url = 'proxy-nl.privateinternetaccess.com:1080'; // current one should be here: https://helpdesk.privateinternetaccess.com/hc/en-us/articles/236265587-Can-I-Use-SOCKS5-
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5,
CURLOPT_PROXY => 'socks5://' . $username . ':' . $password . '@' . $pia_url,
@prasadsilva
prasadsilva / fresh-chrome-with-custom-tz.sh
Last active October 8, 2024 12:47 — forked from stuartsierra/fresh-chrome.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, user config and custom Timezone
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@sathlan
sathlan / make_usb.sh
Created April 8, 2013 13:38
create a multiboot freebsd/linux usb key.
#!/bin/sh -x
START_DIR=$CWD
SHARE_DIR=/backup001/chem/home/chem/src/mfsbsd
KEYBOARD=dvorak
WANT_PHORONIX_TEST_SUITE=4.4.1 # set it to no to disable
# catch error from my own error function even in subshell.
err_handler ()
{
rc=$?
@orlp
orlp / ipow.c
Last active February 7, 2025 13:21
int64_t ipow(int64_t base, uint8_t exp) {
static const uint8_t highest_bit_set[] = {
0, 1, 2, 2, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 255, // anything past 63 is a guaranteed overflow with base > 1