Skip to content

Instantly share code, notes, and snippets.

@sinefabula
sinefabula / compress-self-tape
Last active August 1, 2020 11:39
Compresses video with ffmpeg using Handbrake's "Gmail 3min 720p30" preset and normalises audio
#!/usr/bin/env python3
import argparse
import subprocess
def main():
parser = argparse.ArgumentParser(description='compress self tape')
parser.add_argument('input', metavar='INPUT',
@sinefabula
sinefabula / listfiles.gs
Last active April 20, 2020 12:50
List files in Google Drive recursively and find duplicates
/**
* @OnlyCurrentDoc Limits the script to only accessing the current spreadsheet.
*/
var projectName = 'List Files and Find Dupes';
/**
* Adds a custom menu with items to show the sidebar and dialog.
*
* @param {Object} e The event parameter for a simple onOpen trigger.
@sinefabula
sinefabula / time_with_usec.c
Created October 7, 2014 23:48
A code snipped to get time with microseconds in C
#include <time.h>
#include <stdio.h>
int main()
{
struct timespec t;
clock_gettime(CLOCK_REALTIME, &t);
struct tm* loc = localtime(&t.tv_sec);
char tstr[20] = "";
strftime(tstr, 20, "%F %T", loc);
@sinefabula
sinefabula / devtoolset-switch.sh
Created September 16, 2014 13:18
A shell snippet which helps you switch to devtoolset environment inside a script
source /opt/rh/devtoolset-2/enable
export X_SCLS="`scl enable devtoolset-2 'echo $X_SCLS'`"
@sinefabula
sinefabula / install-build-system.sh
Created September 16, 2014 10:48
Script to install devtoolset-based environment on Scientific Linux 6.x or CentOS 6.x
#!/bin/sh
# This script is written for Scientific Linux 6.5 x64.
# Should also work for CentOS 6.5 (see below).
# It should be run as root (not sure whether sudo is fine also).
# boost version to install
boost_ver="1.55.0"
# This is only required with "Minimal" installation variant (for wget & scp).
@sinefabula
sinefabula / .screenrc
Created September 16, 2014 10:28
.screenrc to show a bar with tabs
caption always "%H %= %-w%L>%{= BW}%n*%t%{-}%52<%+w %L="
@sinefabula
sinefabula / vim-init-config.sh
Created September 16, 2014 10:22
My .vimrc deploying script
#!/bin/bash
vimrc="$HOME/.vimrc"
read -d '' vim_conf <<"EOF"
" start scrolling when the cursor is 2 lines from the screen edge
set so=2
" line numbers
set nu
" show incomplete command