Skip to content

Instantly share code, notes, and snippets.

View greenbagels's full-sized avatar
🙂

Sameed Pervaiz greenbagels

🙂
View GitHub Profile
#include <iostream>
#include <vector>
#include <algorithm>
#include <chrono>
template<typename T>
T sum_for_each(std::vector<T> const& vec)
{
T sum = 0;
std::for_each(vec.begin(), vec.end(),
png2yuv -I p -f 24 -b 1 -n 576 -j frames/%d.png > upscale_1440p.yuv
vpxenc --codec=vp9 --good --cpu-used=1 --end-usage=vbr --passes=2 --auto-alt-ref=1 --lag-in-frames=16 --threads=3 --target-bitrate=15000 -o upscale_1440p.webm upscale_1440p.yuv
ffmpeg -i upscale_1440p.webm -i audio.mp3 -c:v copy -c:a opus -strict -2 upscale_1440p_audio.webm
@greenbagels
greenbagels / gist:4475cafd38c2914d411f
Last active August 29, 2015 14:27
RDRAND rngd rngtest
λ ~/ cat /dev/random | rngtest -c 1000
rngtest 5
Copyright (c) 2004 by Henrique de Moraes Holschuh
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rngtest: starting FIPS tests...
rngtest: bits received from input: 20000032
rngtest: FIPS 140-2 successes: 1000
rngtest: FIPS 140-2 failures: 0
rngtest: FIPS 140-2(2001-10-10) Monobit: 0
@greenbagels
greenbagels / gist:2a3095b91f66cfb90887
Created August 12, 2015 21:10
boinc version error
λ ~/ boinc
12-Aug-2015 17:02:32 [---] cc_config.xml not found - using defaults
12-Aug-2015 17:02:32 [---] Starting BOINC client version 7.2.42 for x86_64-pc-linux-gnu
12-Aug-2015 17:02:32 [---] log flags: file_xfer, sched_ops, task
12-Aug-2015 17:02:32 [---] Libraries: libcurl/7.43.0 OpenSSL/1.0.2d zlib/1.2.8 libidn/1.30 libssh2/1.6.0
12-Aug-2015 17:02:32 [---] Data directory: /home/sam
execv: No such file or directory
12-Aug-2015 17:02:32 [---] GPU detection failed. error code 512
12-Aug-2015 17:02:32 [---] No usable GPUs found
12-Aug-2015 17:02:32 [---] Host name: srsbsns
λ ~/ cat .local/share/xorg/Xorg.0.log [ 63.881]
X.Org X Server 1.17.2
Release Date: 2015-06-16
[ 63.881] X Protocol Version 11, Revision 0
[ 63.881] Build Operating System: Linux 4.0.4-2-ARCH x86_64
[ 63.881] Current Operating System: Linux srsbsns 4.1.7.201509131604-1-grsec #1 SMP PREEMPT Mon Sep 14 00:45:54 EDT 2015 x86_64
[ 63.881] Kernel command line: BOOT_IMAGE=/vmlinuz-linux-grsec root=UUID=2fdee005-88ba-44a6-b46f-01e94bae9020 rw quiet cryptdevice=UUID=59983039-e886-4715-aca4-644af9798dfc:lvm-SSD:allow-discards resume=/dev/mapper/SSD-swap--arch root=/dev/mapper/SSD-root--arch
[ 63.881] Build Date: 17 July 2015 05:38:19PM
[ 63.881]
[ 63.881] Current version of pixman: 0.32.6
λ ~/ cd /tmp/
λ /tmp/ git clone https://www.github.com/knightos/corelib
Cloning into 'corelib'...
remote: Counting objects: 331, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 331 (delta 0), reused 0 (delta 0), pack-reused 320
Receiving objects: 100% (331/331), 63.82 KiB | 0 bytes/s, done.
Resolving deltas: 100% (188/188), done.
Checking connectivity... done.
λ /tmp/ cd corelib
bbbbiogs
i gbbosbb
iobbsg bb
gbi bsobb
bigbobb s
gibb sbob
b bsbbgoi
ogbsi bbb
bsgbbi ob
bobsbgib
@greenbagels
greenbagels / goodyear.sh
Last active March 12, 2016 03:37
JHS Goodyear Rube Goldberg Challenge
#!/bin/bash
# Don't forget to chmod +x this file if you want to make it executable!
if ! [ -e GOODYEAR-LOGO.jpg ] && ! [ -e logo ]
# Let's avoid redownloading the image each time...
then wget https://corporate.goodyear.com/content/dam/goodyear-corp/images/image-gallery/GOODYEAR-LOGO.jpg
# What better way to obtain the Goodyear logo than straight from Goodyear itself?
file GOODYEAR-LOGO.jpg > logo
# Will ALWAYS OVERWRITE the file named `logo` with image metadata.
jp2a GOODYEAR-LOGO.jpg >> logo
# Will ALWAYS APPEND the ASCII art to the file named `logo`
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;using v=std::vector<int>;string escape(v j,int i){v h;do{h.push_back(i);try{if(i<=1?0:!((lround(tgamma(i))+1)%i)){i-=j[i];}else{i=j[i];}}catch(const out_of_range& e){cerr<<i;}}while(find(h.begin(),h.end(),i)!=h.end());return string("false");}
@greenbagels
greenbagels / urls
Last active December 6, 2016 22:14
https://ipfs.io/ipfs/QmakBDmvWsFt8ax6NS1GYh2BbbLQX2QeF9vSDbQYry8nG6/ <--- hosted by alu
https://ipfs.io/ipfs/Qmf1w5GiN4HZ7LwM3rX7jjJcos8SMJftnajTSMZRTx2C4y/ <--- hosted by me
https://ipfs.io/ipfs/QmRw99q1hU7oFrTQrHPMZvozNTvEcqEAG32DFJFGh5HBUR/ <--- fix't
http://sprunge.us/WKZC <--- room source
https://www.sharelatex.com/project/58403168c0ba0b593dc82134/output/output.pdf <--- artist statement