Skip to content

Instantly share code, notes, and snippets.

@yewton
yewton / crop_last_n_seconds.sh
Last active January 5, 2019 12:44
Crop last N seconds w/ FFmpeg one-liner
gfind . -name '*.mp4' -print0 | gxargs -0 -I{} sh -c 'ffmpeg -i "{}" -t $(echo "$(ffprobe -i "{}" -show_entries format=duration -v quiet -of csv="p=0") - 15" | bc) "cropped_$(basename "{}")"'
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 17, 2024 04:56 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@shoito
shoito / about-gcache.md
Last active August 31, 2018 10:05
Galera ClusterのGCacheについてのメモ書き

GCacheについて、サービス開発・運用する人誰もが知っとくべき情報

https://www.percona.com/blog/2016/11/16/all-you-need-to-know-about-gcache-galera-cache/

gcacheは「キャッシュ」と名前だが、「メモリ」とは無関係のもの。 データ構造としてはリングバッファ。

クラスタ内のノードがダウンしてしまった場合、ノードが復旧しクラスタに再加入した際のデータの差分を埋めるための方法として、Galeraは以下の2つの方法がある。

3ノード構成のクラスタで、以下の状態を想定して説明

@masuhajime
masuhajime / gist:e7b8b4cab6c6037f1bbe
Created March 12, 2015 06:30
html中の<input type="radio"> をランダムに選択するBookMarklet
javascript:(function(){var url='//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js';if(!url.match(/\?/))url+='?t='+(new Date()).getTime();var d=document;var e=d.createElement('script');e.charset='utf-8';e.src=url;d.getElementsByTagName('head')[0].appendChild(e);function shuffle(t){for(var n,u,h=t.length;h;)u=Math.floor(Math.random()*h--),n=t[h],t[h]=t[u],t[u]=n}var inputs=[];$("input[type=radio]").each(function(){inputs.push($(this))}),shuffle(inputs);for(var j=0;j<inputs.length;j++)inputs[j].prop("checked",!0);})();
@watermint
watermint / application-logger.xml
Created October 7, 2013 12:56
Configure Play2.2/Scala logging format as LTSV (Labeled Tab-separated Values).
<configuration>
<conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" />
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${application.home}/logs/application.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${application.home}/logs/application.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>14</maxHistory>
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
;; Copyright (C) 2007,2008,2009,2010 Hiroki Yagita.
;; ポリシー ----------------------------------------------------------
;; - meadow は捨てました
;; - xemacs は捨てました
;; - なるべくどこでも動くようにしたい
;; - 初期化スクリプトは ~/.emacs.d/init.el にしています
;; - ~/.emacs.d/ の下に分離スクリプトやデータを置くことがあります(それ以外の場所に置かない)
;;; clarity-theme.el --- Clarity and beauty, imported from color-theme 6.6.0
(deftheme clarity
"Clarity and beauty, imported from color-theme 6.6.0")
(custom-theme-set-faces 'clarity
'(default ((t (:stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "outline" :family "Courier New"))))
'(bold ((t (:weight bold))))
'(italic ((t (:slant italic))))
'(bold-italic ((t (:slant italic :weight bold))))
@diasjorge
diasjorge / init_packages.el
Created October 31, 2011 09:54
Bootstrapping el-get + packages
(setq el-get-sources
'((:name package-name)))
(defun sync-packages ()
"Synchronize packages"
(interactive)
(el-get 'sync '(el-get package))
(add-to-list 'package-archives '("tromey" . "http://tromey.com/elpa/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(setq my-packages (mapcar 'el-get-source-name el-get-sources))