Skip to content

Instantly share code, notes, and snippets.

View bensuperpc's full-sized avatar
🕐
Working

Bensuperpc bensuperpc

🕐
Working
View GitHub Profile
@alkavan
alkavan / gource-commands.txt
Created April 11, 2010 16:41
Gource and ffmpeg Commands
################################
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
@oldcai
oldcai / compression_benchmark.py
Last active March 30, 2024 13:11
zlib vs lz4 vs lzma vs zstd compression
import time
import requests
import zlib
#!pip install lz4 pylzma zstd
import lz4.block
import pylzma as lzma
import zstd
def measure_time_and_compress_decompress(compress_func, decompress_func, data, *args):
# Measure compression time

CLang optimizations on Mac OSX

Version:

Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

This was made with commands:

@elvinio
elvinio / tcp_poll.cpp
Created July 24, 2015 01:17
C++: how to poll the TCP socket to read and write data.
void poller(int socketIn, std::string srcIP, int port){
struct pollfd fds[2];
// Initialize the fds to 0
memset(fds, 0, sizeof(fds));
// Wait in ms before poll times out. -1 for infinite
int timeout = 15000;
fds[0].fd = socketIn;
@xerpi
xerpi / .config
Last active September 19, 2021 00:50
Buildroot .config Nintendo 3DS Linux
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2020.11-312-gfd5eeabac0 Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_HOST_GCC_AT_LEAST_4_9=y
BR2_HOST_GCC_AT_LEAST_5=y
BR2_HOST_GCC_AT_LEAST_6=y
BR2_HOST_GCC_AT_LEAST_7=y
BR2_HOST_GCC_AT_LEAST_8=y
@dreikanter
dreikanter / encrypt_openssl.md
Last active May 2, 2024 12:55 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@xerpi
xerpi / make_3ds.sh
Last active April 27, 2023 10:33
Linux 3DS scripts
#!/bin/sh
TOOLCHAIN=/opt/armv6-eabihf--glibc--bleeding-edge-2020.02-2/bin/arm-buildroot-linux-gnueabihf-
cp arch/arm/configs/nintendo3ds_defconfig .config
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN -j8
make ARCH=arm CROSS_COMPILE=$TOOLCHAIN nintendo3ds_ctr.dtb
echo "Output file: ./arch/arm/boot/zImage"
@mikoim
mikoim / README.md
Last active April 27, 2024 00:22
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@mlorant
mlorant / region-dpts-France.py
Created December 20, 2016 15:24
Liste des régions et départements français (dict. Python)
REGIONS = {
'Auvergne-Rhône-Alpes': ['01', '03', '07', '15', '26', '38', '42', '43', '63', '69', '73', '74'],
'Bourgogne-Franche-Comté': ['21', '25', '39', '58', '70', '71', '89', '90'],
'Bretagne': ['35', '22', '56', '29'],
'Centre-Val de Loire': ['18', '28', '36', '37', '41', '45'],
'Corse': ['2A', '2B'],
'Grand Est': ['08', '10', '51', '52', '54', '55', '57', '67', '68', '88'],
'Guadeloupe': ['971'],
'Guyane': ['973'],
'Hauts-de-France': ['02', '59', '60', '62', '80'],
@kmhofmann
kmhofmann / building_tensorflow.md
Last active March 2, 2024 18:37
Building TensorFlow from source

Building TensorFlow from source (TF 2.3.0, Ubuntu 20.04)

Why build from source?

The official instructions on installing TensorFlow are here: https://www.tensorflow.org/install. If you want to install TensorFlow just using pip, you are running a supported Ubuntu LTS distribution, and you're happy to install the respective tested CUDA versions (which often are outdated), by all means go ahead. A good alternative may be to run a Docker image.

I am usually unhappy with installing what in effect are pre-built binaries. These binaries are often not compatible with the Ubuntu version I am running, the CUDA version that I have installed, and so on. Furthermore, they may be slower than binaries optimized for the target architecture, since certain instructions are not being used (e.g. AVX2, FMA).

So installing TensorFlow from source becomes a necessity. The official instructions on building TensorFlow from source are here: ht