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 / 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.

// APIStoreProps are properties that need to be
// ignored when running APIStore.makeStore()
const APIStoreProps = ['use', 'classes', 'constructor', 'init', 'state']
// getMethods returns methods defined
// in a given class' prototype, except init and constructor
const getMethods = (cls) => {
return Object.getOwnPropertyNames(cls.prototype)
.reduce((obj, prop) => {
@timelf123
timelf123 / cloudflare-workers-apilityio.js
Created October 17, 2019 01:58 — forked from diegoparrilla/cloudflare-workers-apilityio.js
Using Cloudflare Workers and https://Apility.io API add to the request headers information of the blacklists of abusers that contains the IP address of the client.
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckOrigin(event.request))
})
async function fetchAndCheckOrigin(req) {
try {
startTime = new Date();
const body = await req.body;
const ip = req.headers.get('cf-connecting-ip');
const es = req.headers.get('cf-ipcountry');