Skip to content

Instantly share code, notes, and snippets.

@taesiri
taesiri / FontFusion.pde
Last active December 25, 2018 22:34
Font Fusion
PFont myFont;
void setup() {
size(1000, 1000);
String[] fontList = PFont.list();
int counter = 0;
background(0);
for(String fontName : fontList) {
myFont = createFont(fontName, 210);
@taesiri
taesiri / README.md
Last active December 20, 2018 11:54
Blink for every ssh sessions.

Blink for SSH User

🔴 Blink in proportion to the number of active ssh sessions! ⚪

Demo?

Blink for me!

Why?

Because plain blink sample is super boring. And also this kind of useful!

@taesiri
taesiri / Draw.js
Created November 8, 2018 22:40
Canvas Drawing
var fs = require('fs');
var es = require('event-stream');
const { createCanvas } = require('canvas');
const canvas = createCanvas(1000, 1000);
const ctx = canvas.getContext('2d');
Number.prototype.clamp = function(min, max) {
return Math.min(Math.max(this, min), max);
};
@taesiri
taesiri / SocksRouter.sh
Created November 5, 2018 23:09
SocksRouter
#!/bin/bash
#
# <Original Author is not known>
#
########################################################################
# This bash script will create a socksifying router and pass all subnet
# traffic through
# a socks5 proxy. As the script is now written, local traffic is not
# proxied, however, make the change noted below and it will be.
#
@taesiri
taesiri / birthday.ipynb
Created June 5, 2018 08:40
The Birthday Problem
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@taesiri
taesiri / ffmpeg mega tile.sh
Last active February 6, 2018 13:33
Boring Automators
#!/bin/bash
# sample video tiler using ffmpeg (for generating giant tiled video out of many tiny videos)
ffmpeg -i 0001.mp4 -i 0002.mp4 -i 0003.mp4 -i 0004.mp4 -i 0005.mp4 -i 0006.mp4 -i 0007.mp4 -i 0008.mp4 -i 0009.mp4 -i 0010.mp4 -i 0011.mp4 -i 0012.mp4 -i 0013.mp4 -i 0014.mp4 -i 0015.mp4 -i 0016.mp4 -i 0017.mp4 -i 0018.mp4 -i 0019.mp4 -i 0020.mp4 -i 0021.mp4 -i 0022.mp4 -i 0023.mp4 -i 0024.mp4 -i 0025.mp4 -i 0026.mp4 -i 0027.mp4 -i 0028.mp4 -i 0029.mp4 -i 0030.mp4 -i 0031.mp4 -i 0032.mp4 -i 0033.mp4 -i 0034.mp4 -i 0035.mp4 -i 0036.mp4 -i 0037.mp4 -i 0038.mp4 -i 0039.mp4 -i 0040.mp4 -i 0041.mp4 -i 0042.mp4 -i 0043.mp4 -i 0044.mp4 -i 0045.mp4 -filter_complex "
nullsrc=size=4608x2560 [TMP0];
[0:v] setpts=PTS-STARTPTS, scale=512x512 [INPUT0];
[1:v] setpts=PTS-STARTPTS, scale=512x512 [INPUT1];
[2:v] setpts=PTS-STARTPTS, scale=512x512 [INPUT2];
[3:v] setpts=PTS-STARTPTS, scale=512x512 [INPUT3];
@taesiri
taesiri / record.sh
Created November 10, 2017 09:58
ffmpeg + v4l2
ffmpeg -f x11grab -r 60 -s 800x600 -i :1 -c:v rawvideo -pix_fmt bgr24 -f v4l2 /dev/video0

Keybase proof

I hereby claim:

  • I am taesiri on github.
  • I am taesiri (https://keybase.io/taesiri) on keybase.
  • I have a public key ASD2lz-Fy23RXEWp1cgiyh5d-jc8ya3jjGFSc_tL6N-n6wo

To claim this, I am signing this object:

@taesiri
taesiri / Readme.md
Last active October 15, 2017 13:34
gpu.js Hello World!

gpu.js Hello World

Hello World sample in gpu.js

Screenshot

@taesiri
taesiri / fftube.py
Last active August 24, 2017 12:20
Extract frames from youtube videos
import argparse
import youtube_dl
import ffmpy
samples_per_video = 10
game_dic = {}
def save_frame(url, time, game_name):
if game_name not in game_dic.keys():
game_dic[game_name] = 0