Skip to content

Instantly share code, notes, and snippets.

@tendant
tendant / LICENSE
Created February 23, 2022 21:50 — forked from cryptix/LICENSE
example of using JWT for http authentication in go
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@tendant
tendant / ANSI.md
Created August 11, 2021 18:50 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
@tendant
tendant / create-vod-hls.sh
Created August 5, 2021 23:31 — forked from maitrungduc1410/create-vod-hls.sh
Bash scripts to create VOD HLS stream with ffmpeg (Extended version)
#!/usr/bin/env bash
START_TIME=$SECONDS
set -e
echo "-----START GENERATING HLS STREAM-----"
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
# comment/add lines here to control which renditions would be created
renditions=(
@tendant
tendant / ffmpeg.md
Created August 5, 2021 23:26 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@tendant
tendant / ants.clj
Created November 17, 2020 06:32 — forked from jjcomer/ants.clj
Ant Simulation -- From Clojure Concurrency Presentation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
;As shown in the presentation: http://blip.tv/clojure/clojure-concurrency-819147
@tendant
tendant / profiles.clj
Created February 10, 2020 17:25 — forked from joinr/profiles.clj
An example of a file-repo that mirrors central and clojars so that we don't touch the network, along with comments about weird error messages...
;;Say I don't want to ever touch the internet. Say I've written all my
;;awesome clojure stuff, and I have built up a bunch of libraries in
;;my local .m2 repo. Important caveat: say none of these libraries
;;got there via 'lein install', if they did....we got problems and
;;likely will get wierd errors. Let's say, for now, every lib
;;is downloaded from either clojars or maven central.
;;If we were to copy our .m2 folder to another place....say
;;a network file folder, or just a local file folder like
;;c:/Users/tom/repos/, we can force lein to look there
kubectl -n kube-system create sa jenkins
kubectl create clusterrolebinding jenkins --clusterrole cluster-admin --serviceaccount=<namespace>:jenkins
@tendant
tendant / ss2.yml
Created September 12, 2018 05:48 — forked from baryon/ss2.yml
翻墙回国听音乐+屏蔽广告
adapter:
#ss代理, 在国内购买一台云服务器,安装好ShadowSocks代理服务器,iPhone版安装Wingy APP (SMART LIMITED的深蓝紫色免费版)。使用的本文的自定义配置YAML
- id: proxyAdapter
type: ss
#修改ss_host为服务器地址
host: ss_host
#修改ss_port为端口号
port: ss_port
#修改ss_password为密码
password: ss_password
@tendant
tendant / passgitgpg.md
Created June 16, 2018 17:50 — forked from flbuddymooreiv/passgitgpg.md
Setting up pass on git with a gpg key

The following shell transcript shows how to:

  • Create a GPG key
  • Create a pass database
  • Add git support to the pass database
  • Create a remote git repository
  • Push the pass database to the remote git repository
  • Fetch and display your passwords from another host

It is assumed that the pass package has been installed on both the first and second computers.

@tendant
tendant / gist:e69524b8ad74663979362a85bbf208bc
Last active June 16, 2018 08:55 — forked from rmondello/gist:b933231b1fcc83a7db0b
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

This is the process I used to create a CSV file of his credentials in the format “example.com,user,pass”. This portable format would be pretty easy to import into 1Password or Safari in the future.

The way I went about this isn’t great; it opens up more opportunities for apps to control one’s Mac through Accessibility APIs, it writes plaintext passwords to disk, and it could use some cleaning up. A better approach might leverage the security command line tool that ships with OS X. That said, I found this method to be a fun illustration of what’s possible us