Skip to content

Instantly share code, notes, and snippets.

View meinside's full-sized avatar
🤡
I hope my code makes more cents than my life.

Sungjin Han meinside

🤡
I hope my code makes more cents than my life.
View GitHub Profile
@meinside
meinside / smartctl_test.md
Last active March 20, 2024 21:26
For checking health of usb hdd on raspberry pi with smartctl.

for testing external hdd with smartctl,

install smartmontools

$ sudo apt-get install smartmontools

start test,

@meinside
meinside / README.md
Last active November 8, 2023 19:56
VSCode files for debugging a Raspberry Pi Pico application with Picoprobe (Debug Probe)
  • Files:

    • launch.json: .vscode/launch.json file in your project directory.
    • settings.json: .vscode/settings.json file in your project directory.
  • Environment Variables:

export PICO_SDK_PATH="<path-to-your-pico-sdk-directory>"
export OPENOCD_PATH="<path-to-your-openocd-directory>"
@meinside
meinside / backup_vaultwarden.sh
Created February 17, 2023 00:00
Backup script for Vaultwarden
#!/usr/bin/env bash
# backup_vaultwarden.sh
#
# Backups up `db.sqlite3` and `attachments` from vaultwarden.
#
# last update: 2023.02.16.
# XXXX: edit following values
VAULTWARDEN_WORKING_DIR="/home/me/my-files/vaultwarden"
@meinside
meinside / 2webm.rb
Last active August 11, 2022 01:04
Slice & convert given video files to .webm format. WebM 짤방 제조용 스크립트.
#!/usr/bin/env ruby
# coding: UTF-8
# 2webm.rb
#
# convert given video file to .webm format
#
# (ffmpeg should be installed with libvpx and libvorbis.
#
# ex: $ brew install ffmpeg --with-libvpx --with-libvorbis)
@meinside
meinside / 2gif.rb
Last active July 6, 2022 04:33
Slice & convert given video files to .gif format. GIF 짤방 제조용 스크립트. (Tested on OSX & ffmpeg built with 'brew install ffmpeg --with-libvpx --with-libvorbis')
#!/usr/bin/env ruby
# frozen_string_literal: true
# 2gif.rb
#
# https://gist.github.com/meinside/62c442900e6d73d5d3d9
#
# Convert video to gif.
# * referenced: http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
#
@meinside
meinside / shift_srt.rb
Last active May 3, 2022 08:16
Shift times in a .srt file
#!/usr/bin/env ruby
# frozen_string_literal: false
# Shift times in given .srt file
#
# ./shift_srt.rb [SRT_FILEPATH] [MSECS_TO_SHIFT]
#
# ex: ./shift_srt.rb some_srt_file.srt 420
#
# created by meinside@duck.com
@meinside
meinside / inline_image.rb
Last active May 3, 2022 08:14
generates in-line image tag (html)
#!/usr/bin/env ruby
# coding: UTF-8
# inline_image.rb
#
# generates in-line image tag
# (referenced: http://en.wikipedia.org/wiki/Data_URI_scheme)
#
# created on : 2013.06.30
# last update: 2013.06.30
@meinside
meinside / pushbullet-transmission.go
Last active May 3, 2022 08:08
send push through pushbullet on transmission(torrent) completion.
/*
Send a message on Transmission(torrent) completion:
https://trac.transmissionbt.com/wiki/Scripts
* Created on : 2015.07.07.
* Last update: 2015.07.16.
* by meinside@duck.com
@meinside
meinside / notify-ssh-login.sh
Last active May 3, 2022 08:08
Notify with pushbullet message on successful ssh logins
#!/bin/bash
#
# notify-ssh-login.sh
#
# Notifies successful ssh logins through pushbullet
#
# NOTE: this script will be run as root, so don't forget to put related config files under /root/.config/
#
#
# last update: 2019.06.05.
@meinside
meinside / notify-fail2ban.sh
Last active May 3, 2022 08:08
Notify with pushbullet message on fail2ban's ban actions
#!/bin/bash
#
# notify-fail2ban.sh
#
# Notifies on fail2ban's ban actions through pushbullet
#
# NOTE: this script will be run as root, so don't forget to put related config files under /root/.config/
#
# USAGE: $ ./notify-fail2ban.sh 8.8.8.8 ssh
#