This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a timelapse video from many images | |
ffmpeg -r 60 -pattern_type glob -i "*.JPG" -s 1920x1440 -vcodec libx264 output.mp4 | |
# -r <framerate> : output framerate | |
# -pattern_type glob : allow for * input | |
# -i <pattern> : input files pattern | |
# -s <size> : output size (4000x3000 -> 1920x1440 is suitable for GoPro output) | |
# -vcodec <codec> : output codec (see ffmpeg -codecs) (libx264 for standard mpeg-4 avc) (libx265 for hevc) | |
# May also be relevant to rotate the output: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: script <source file/directory> <gpg recipient> <ssh login@server>:<target directory> [chmod] | |
# Example: /usr/local/bin/backup-tool.sh /home/alice/bwdata [email protected] [email protected]:backups/ 0600 | |
# Example crontab: 0 5 * * * <see example above> | |
# Notes: Remember that elevated permissions is required to read some dirs/files | |
# Remember to add and trust the GPG recipient, otherwise the encryption will fail | |
[ -z "$1" ] && echo "No source file/directory" && exit 1 | |
[ -z "$2" ] && echo "No recipient" && exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const COUNTRY_DATA = { | |
"AF": { | |
"name": "Afghanistan", | |
"iso2": "AF", | |
"tld": "af", | |
"phone": "93", | |
"continent": "Asia", | |
"capital": "Kabul", | |
"time": "Asia/Kabul", | |
"langs": "Afghan Persian or Dari (official) 50%, Pashto (official) 35%, Turkic languages (primarily Uzbek and Turkmen) 11%, 30 minor languages (primarily Balochi and Pashai) 4%, much bilingualism, but Dari functions as the lingua franca", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name DuckDuckGo Force Strict | |
// @namespace - | |
// @version 1.0 | |
// @description Force 'strict' search mode on DuckDuckGo. | |
// @author Josef Andersson | |
// @include *://duckduckgo.com/?* | |
// @icon https://duckduckgo.com/favicon.ico | |
// @grant GM_addStyle | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <X11/Xlib.h> | |
#include <X11/Xutil.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int main(void) { | |
XEvent e; | |
Display *d = XOpenDisplay(NULL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: script <bitwarden data directory> <gpg recipient> <ssh login@server>:<target folder> | |
# Example: script /home/alice/bwdata [email protected] [email protected]:~/backups/ | |
# Note: Requires elevated permissions to read all files in bitwarden data folder | |
[ -z "$1" ] && echo "No data directory" && exit | |
[ -z "$2" ] && echo "No recipient" && exit | |
[ -z "$3" ] && echo "No backup server" && exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name DuckDuckGo Verbatim | |
// @namespace https://github.com/josefandersson/userscripts/ | |
// @version 1.1 | |
// @description Adds a verbatim button to the duckduckgo search bar | |
// @author Josef Andersson | |
// @match https://duckduckgo.com/* | |
// @run-at document-end | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.commands.onCommand.addListener(cmd => { | |
chrome.tabs.query({ currentWindow:true, active:true }, tabs => { | |
const tab = tabs[0]; | |
if (!tab) return; | |
switch (cmd) { | |
case 'move-left': chrome.tabs.move(tab.id, { index:Math.max(0, tab.index-1) }); break; | |
case 'move-right': chrome.tabs.move(tab.id, { index:tab.index+1 }); break; | |
case 'move-to-first': chrome.tabs.move(tab.id, { index:0 }); break; | |
case 'move-to-last': chrome.tabs.move(tab.id, { index:-1 }); break; | |
case 'move-next-window': tabMoveWindow(tab, 1); break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <signal.h> | |
#include <stdio.h> | |
static int send(int pid, int sigval); | |
int | |
main(int argc, char* argv[]) | |
{ | |
if (argc < 4) { | |
printf("Usage: command <PID> <BLOCK> <DATA>\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WinGet, windows, List | |
Loop %windows% | |
{ | |
id := windows%A_Index% | |
WinGetPos, x, y,,, ahk_id %id% | |
WinGetTitle, wt, ahk_id %id% | |
StringLen, tl, wt | |
If tl > 0 And WinExist("ahk_id" . id) | |
{ | |
If x < -8 |
NewerOlder