Skip to content

Instantly share code, notes, and snippets.

@okapies
okapies / mastodon-client.md
Last active October 3, 2023 10:18
Mastodon API の叩き方

Mastodon の API を叩くには以下の手順を踏む必要がある:

  1. OAuth2 クライアントを登録する
  2. アクセストークンを取得する
  3. アクセストークンを Authorization ヘッダに指定して API にアクセスする

OAuth2 クライアント登録

Mastodon の Apps API に登録情報を送ってクライアントを払い出してもらう(一度だけやれば OK).

@Brainiarc7
Brainiarc7 / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Last active April 21, 2024 04:22
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:

Considerations to take when live streaming:

The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown:

@you21979
you21979 / testnet.js
Created November 10, 2016 13:46
coinomiウォレット救済ツール
const bitcoin = require("bitcoinjs-lib")
const bip39 = require('bip39')
const bip32utils = require('bip32-utils')
const insight = require('insight-cli').RestClient
const bip44_account = (m, BIP44) => m.deriveHardened(BIP44.PURPOSE).deriveHardened(BIP44.COINTYPE).deriveHardened(BIP44.ACCOUNT)
const mnemonic = ""
const seed = bip39.mnemonicToSeed(mnemonic, "")
@AGhost-7
AGhost-7 / wineasio-install.sh
Last active February 3, 2023 10:52
How to compile and install wineasio on Ubuntu Xenial 64 bit. This is for Guitar Rig only. Only works with 32 bit...
# Get the dev files for wineasio
git clone git://git.code.sf.net/p/wineasio/code /tmp/wineasio
# Install jack server
sudo apt-get install jackd1 -y
# Going to be using playonlinux to manage the wine executables but I
# still need the development files to compile wineasio
sudo apt-get install playonlinux -y
@ooltcloud
ooltcloud / RSA.VBA
Last active January 4, 2023 03:15
VBA(Excel) で RSA 暗号を Encode/Decode してみる
Sub Main()
' 鍵生成
Call GetKey(publicKey, privateKey)
Debug.Print publicKey
Debug.Print privateKey
' 暗号化
encryptString = Encrypt(publicKey, "あいう")
Debug.Print encryptString
@Fusl
Fusl / gist:3a708b8c32c9d5264fa0
Last active April 25, 2024 18:43
Streaming audio output from Linux (Pulseaudio) to Windows
# Windows (receiver) side:
.\ffplay.exe -nodisp -ac 2 -acodec pcm_u8 -ar 48000 -analyzeduration 0 -probesize 32 -f u8 -i udp://0.0.0.0:18181?listen=1
# Linux (transmitter) side:
pactl load-module module-null-sink sink_name=remote
ffmpeg -f pulse -i "remote.monitor" -ac 2 -acodec pcm_u8 -ar 48000 -f u8 "udp://RECEIVER:18181"
pavucontrol # Change the default output to the Null sink or move single applications to this "output" device.
@voluntas
voluntas / webrtc.rst
Last active April 30, 2024 14:20
WebRTC コトハジメ
@max-mapper
max-mapper / readme.md
Last active May 21, 2022 11:02
ffmpeg youtube live event rtmp stream from raspberry pi with raspi camera (raspivid)
  1. compile ffmpeg for arm https://github.com/fiorix/ffmpeg-arm
  2. create youtube 'live event'. get rtmp url + session id
  3. run this:
raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/<SESSION>

you can tweak -b and -fps to your liking. the settings above work well for 1080p. by not specifying width or height we get the full 1920x1080 resolution from the raspi camera

@soramugi
soramugi / radiko.sh
Last active April 13, 2024 06:17
radikoをlinuxで聞いたり録音したりするやつ
#!/bin/bash
# https://mtunn.wordpress.com/odroid-u2★セットアップ/radikoの録音・再生(archlinux)/
pid=$$
wkdir='/var/tmp'
playerurl=http://radiko.jp/player/swf/player_3.0.0.01.swf
playerfile="${wkdir}/player.swf"
keyfile="${wkdir}/authkey.png"
auth1_fms="${wkdir}/auth1_fms_${pid}"
auth2_fms="${wkdir}/auth2_fms_${pid}"
@romaninsh
romaninsh / swapon.service
Created December 1, 2014 10:05
Set up swap on CoreOS
create this file in your /root folder
$ fleetctl load swapon.service
$ fleetctl start swapon.service
This will create swap file on all nodes of your CoreOS cluster without prior setup.
See also http://cloudinit.readthedocs.org/en/latest/topics/examples.html#adjust-mount-points-mounted