Skip to content

Instantly share code, notes, and snippets.

View avindra's full-sized avatar
🙏
Acepit

Avindra Goolcharan avindra

🙏
Acepit
View GitHub Profile
@brycied00d
brycied00d / multi-bg-set.sh
Created September 3, 2011 03:13
Multi-monitor background splitter and setter
#!/bin/bash
# Easy to use!
# awsetbg -u /path/to/multi-bg-set.sh -r /path/to/images
# Or, just call it by itself: /path/to/multi-bg-set.sh /path/to/some/image.ext
INPUT=$1
if [ ! -f "$INPUT" ]
then
echo "Input file must exist!"
exit 1
@harish2704
harish2704 / zypper_dup_print_urls.py
Created October 1, 2018 18:17
parallel downloads while doing zypper distribution upgrade
#!/usr/bin/env python2
"""
This script will print package urls which need to be downloaded for 'distrubution upgrade'
Printed urls can be used for downloading packages in parallel.
For eg: we can use GNU parallel commanline tool along with wget/curl for parallel downloading
python2 zypper_dup_print_urls.py | parallel --tmuxpane -j4 --colsep ' ' mkdir -p '{1}/{2}' \; cd '{1}/{2}' \; wget -c {3}
will download packages with 4 simultaneous downloads
"""
@dbb
dbb / fancy_urxvt
Created January 18, 2011 23:07
urxvt with transparency, blur, Xft font, etc
urxvt.perl-ext-common: default,tabbed,matcher,searchable-scrollback
urxvt*cutchars: "()*,<>[]{}|'
urxvt*termName: rxvt-unicode
urxvt*urlLauncher: iceweasel
urxvt*matcher.button: 1
urxvt*keysym.S-Prior: ^[[5;2~
urxvt*keysym.S-Next: ^[[6;2~
urxvt*geometry: 100x30
urxvt*highlightSelection: true
@henrik
henrik / README.markdown
Created February 6, 2009 21:49
Stitch Zoomify tiles into a single image (Ruby + ImageMagick).
@anotherjesse
anotherjesse / README.md
Created September 25, 2021 13:35
golang ffmpeg imagepipe streaming

using golang to create image pipe for ffmpeg

If you want to stream a slideshow using ffmpeg, it seems like one easy way to do it is to create an imagepipe of the files.

This can then be streamed to twitch.tv or youtube ... https://trac.ffmpeg.org/wiki/StreamingGuide

This sample cycles between images on disk

usage

@laurenarcher
laurenarcher / livestreamingyoutube
Created November 21, 2014 14:13
Livestreaming to Youtube Live, Ubuntu, Linux FFMPEG
Terminal Commands:
One webcam:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
Two webcam overlay:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
const LOOKUP =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
export function encodeBase64(buffer) {
const view = new Uint8Array(buffer);
let out = [];
for (let i = 0; i < view.length; i += 3) {
const [b1, b2 = 0x10000, b3 = 0x10000] = view.subarray(i, i + 3);
out.push(
b1 >> 2,
@reyjrar
reyjrar / New-iTerm-Window.scpt
Created February 8, 2012 13:14
AppleScript to Open a New iTerm Window and bring it to the front
(*
* New-iTerm-Window.scpt
*
* Intended for use with QuickSilver
* I mapped option-y to running this script to create
* a new iTerm window on the current workspace
*
* Based on much Googling - very little "original" code here
* Comments/Suggestions to brad.lhotsky@gmail.com
*)
@takuya-murao
takuya-murao / disable-onmousedown-in-google-search-results-page.user.js
Last active October 14, 2022 01:07
Disable onmousedown in Google search results page
// ==UserScript==
// @name Disable onmousedown in Google search results page
// @namespace https://gist.github.com/3081371
// @include http://www.google.*/search?*
// @include https://www.google.*/search?*
// ==/UserScript==
(function () {
var disableOnmousedown = function (node) {
var a, i;
// ==UserScript==
// @name Disable onmousedown in Google search results page
// @namespace https://gist.github.com/chris-kwl/6172eb00971ab81bf99a213682b42e21
// @include http://www.google.tld/search?*
// @include https://www.google.tld/search?*
// ==/UserScript==
(function () {
var disableOnmousedown = function (node) {
var a, i;