Skip to content

Instantly share code, notes, and snippets.

@timelf123
timelf123 / gource-multiple-repositories.sh
Created November 7, 2023 14:56 — forked from cgoldberg/gource-multiple-repositories.sh
Generates gource video of multiple source code repositories.
#!/usr/bin/env bash
# Generates gource video out of multiple repositories.
# First, get a local branch/clone of each repository.
# Then, pass the repositories as command line arguments.
#
# Example:
# $ gource-multiple-repositories.sh /path/to/repo1 /path/to/repo2
@timelf123
timelf123 / gource-commands.txt
Created November 7, 2023 14:43 — forked from rafi/gource-commands.txt
Gource command
################################
gource commands
################################
# basic command for big and long projects
gource --max-user-speed 500 --seconds-per-day 0.05 --file-idle-time 10 -e 0.005 -f --max-files 300 --hide-files
# some easy to understand commands
# for output file
--output-ppm-stream ~/ppm/ppm-kohana
@timelf123
timelf123 / capture-graphql.py
Created March 31, 2023 22:39
mitmdump -s capture-graphql.py
# mitmdump -s capture-graphql.py
import json
import re
from mitmproxy import http
def response(flow: http.HTTPFlow) -> None:
if flow.request.url.endswith('/graphql'):
payload = json.loads(flow.request.content.decode('utf-8'))
filename = re.sub(r'[^a-zA-Z0-9]', '_', payload['operationName']) + '.graphql.txt'
@timelf123
timelf123 / powershell_dynamic_ip_notifier.ps1
Created December 12, 2022 15:54
Cross platform powershell to notify you when your dynamic IP changes
<#
Before you execute this, run this in powershell to get notification script installed:
Install-Module -Name PoshNotify
#>
$LOG="$HOME/.myip"
# Update the log file and show a notification with the current IP
function Update() {
@timelf123
timelf123 / user.boxstarter.ps1
Last active September 13, 2022 19:15 — forked from asford/tyger.boxstarter.ps1
Winget Boxstarter Developer
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
# OR
# Install-BoxstarterPackage -PackageName <URL-TO-RAW-GIST> -DisableReboots
#
@timelf123
timelf123 / lower_bound.js
Created September 22, 2017 14:08 — forked from Gattermeier/lower_bound.js
Lower bound of Wilson score confidence interval for a Bernoulli parameter
// Node.js implementation of Evan Miller's algorithm for ranking stuff based on upvotes:
// http://www.evanmiller.org/how-not-to-sort-by-average-rating.html
const stats = require('simple-statistics')
const lower_bound = (upvotes, n = 0, confidence = 0.95) => {
if (n === 0) return 0
// for performance purposes you might consider memoize the calcuation for z
const z = stats.probit(1-(1-confidence)/2)
@timelf123
timelf123 / description.md
Created September 22, 2017 14:08 — forked from honza/description.md
Ranking algorithm - Lower bound of Wilson score confidence interval for a Bernoulli parameter All implementations use 95% probability.

Ranking algorithm

Lower bound of Wilson score confidence interval for a Bernoulli parameter

All implementations use 95% probability.

pos is the number of positive votes, n is the total number of votes.

Source

@timelf123
timelf123 / getnames.py
Created January 23, 2018 04:25 — forked from ErikBoesen/getnames.py
Given a file ./tokens.txt containing many Discord bot tokens, this script will attempt login with each, and write valid tokens (plus their names and how many servers they're in) to ./valid.csv.
import discord
import asyncio
class Bot(discord.Client):
def __init__(self, token):
super().__init__()
self.token = token
print('%s->' % token, end='')
async def on_ready(self):
@timelf123
timelf123 / pvenode-rename
Created June 9, 2020 22:03 — forked from pierew/pvenode-rename
Changing a Proxmox VE Nodes name when it is not in a cluster
OLDNAME=$(hostname)
hostnamectl set-hostname ${1}
mkdir -p /etc/pve/nodes/${1}
cp -a /etc/pve/nodes/${OLDNAME} /etc/pve/nodes/${1}
echo 'A reboot is required, Exit with CTRL-C'
read
@timelf123
timelf123 / gcp-gpu-vm-hashcat.md
Created December 9, 2019 23:19 — forked from koenrh/gcp-gpu-vm-hashcat.md
Running Hashcat on Google Cloud's new GPU-based VMs

Running Hashcat on Google Cloud's GPU-based VMs

In February 2017, Google announced the availability GPU-based VMs. I spun up a few of these instances, and ran some benchmarks. Along the way, I wrote down the steps taken to provision these VM instances, and install relevant drivers.

Update April 2019: Updated instructions to use instances with the Tesla T4 GPUs.