Skip to content

Instantly share code, notes, and snippets.

View dangpzanco's full-sized avatar

Daniel Zanco dangpzanco

View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@LukeZGD
LukeZGD / ios-downgrade-dualboot.md
Last active April 24, 2024 01:17
Downgrade and dualboot status of almost all iOS devices

Downgrade and dualboot status of almost all iOS devices

UPDATED: 2024-04-09

@bsless
bsless / vpn-setup.sh
Last active April 20, 2024 11:25
Set up a bunch of OpenVPN connections using nmcli with username and password
#!/usr/bin/env bash
USERNAME="$1"
PASS="$2"
for f in *.ovpn
do
name=`basename -s .ovpn $f`;
nmcli connection import type openvpn file $f
nmcli connection modify "${name}" +vpn.data connection-type=password-tls
@shaypal5
shaypal5 / confusion_matrix_pretty_print.py
Last active April 12, 2024 14:24
Pretty print a confusion matrix with seaborn
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14):
"""Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap.
Note that due to returning the created figure object, when this funciton is called in a
notebook the figure willl be printed twice. To prevent this, either append ; to your
function call, or modify the function by commenting out the return expression.
@ax3l
ax3l / CUDA_Compilers.md
Last active April 8, 2024 09:57
CUDA Compilers
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@nikhan
nikhan / twitter.sh
Created January 1, 2016 04:45
twitter ffmpeg
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
@mcnees
mcnees / graph paper.tex
Last active February 16, 2024 08:34
Make your own quadrille, graph, hex, etc paper! Uses the pgf/TikZ package for LaTeX, which should be part of any modern TeX installation.
%%-----------------------------------------------------------------------
%% Make your own quadrille, graph, hex, etc paper!
%% Uses the pgf/TikZ package for LaTeX, which should be part of
%% any modern TeX installation.
%% Email: mcnees@gmail.com
%% Twitter: @mcnees
%%-----------------------------------------------------------------------
\documentclass[11pt]{article}
@bogdan-kulynych
bogdan-kulynych / install-cuda-10-bionic.sh
Last active December 5, 2023 10:26
Install CUDA 10 on Ubuntu 18.04
# WARNING: These steps seem to not work anymore!
#!/bin/bash
# Purge existign CUDA first
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
@graymouser
graymouser / hb_all_books_dl.js
Created February 28, 2016 14:09
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
*/
$('a').each(function(i){
if ($.trim($(this).text()) == 'MOBI') {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
});