Skip to content

Instantly share code, notes, and snippets.

View viper25's full-sized avatar

Joseph viper25

  • 05:27 (UTC +08:00)
View GitHub Profile
@viper25
viper25 / Extract YouTube Video.md
Last active April 19, 2024 04:19
Useful ffmpeg Commands

Extract YouTube Video

  • Download yt-dlp
  • Download Video: yt-dlp "https://www.youtube.com/watch?v=1Ut6RouSs0w" -o 1Ut6RouSs0w.webm
  • Run ffmpeg to cut your fragment: ffmpeg -ss 588.4 -t 15 -i 1Ut6RouSs0w.webm -y -c copy video-588.4-15-1Ut6RouSs0w.mp4
@viper25
viper25 / kill.sh
Created November 14, 2021 14:35
Find a process and kill it
ps -ef | grep 'mybot' | grep -v grep | awk '{print $2}' | xargs kill -9
@viper25
viper25 / LetsEncrypt.md
Last active October 21, 2021 07:44
LetsEncrypt

NGIX Config

Check NGIX config

sudo nano /etc/nginx/sites-available/default

Ensure server_name points to the proper DNS name

server_name server.example.com

Install Certbot

@viper25
viper25 / pickle.py
Last active November 1, 2022 10:02
Pickle a File
# Write to pickle
import pickle
filehandler = open(b"df_items.obj","wb")
pickle.dump(df_items,filehandler)
filehandler.close()
# Read
filehandler = open("df_items.obj",'rb')
df_items = pickle.load(filehandler)
@viper25
viper25 / download_youtube.bat
Created February 23, 2021 04:52
Download MP3 from YouTube
@ECHO OFF
@ REM Download Audio from YouTube and encode to MP3
TITLE Download YouTube MP3
set /p url= "Enter Youtube URL:"
echo %url%
youtube-dl %url% --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --output %%(title)s.^%%(ext)s

Mounting VirtualBox shared folders on ubuntu-18.10-desktop-amd64

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on ubuntu-18.10-desktop-amd64

Steps:

  1. Open VirtualBox
  2. Right-click your VM, then click Settings
  3. Go to Shared Folders section
  4. Add a new shared folder
  5. On Add Share prompt, select the Folder Path in your host that you want to be accessible inside your VM.
@viper25
viper25 / gist:9f529067681e1dc77a76372a9c71f6ff
Last active September 17, 2017 06:39
Install Jekyll on Ubuntu

Ubuntu 16.04

$ sudo apt-get update
$ sudo apt-get install ruby ruby-dev make gcc
$ sudo gem install jekyll bundler

see source

How to Start Jekyll

@viper25
viper25 / gist:de35ff3546c0a0cb88c07f16921716df
Created April 22, 2017 05:57
Get Folder size on Linux
du -m -h -c --max-depth=1
@viper25
viper25 / Openvpn.sh
Created April 22, 2017 05:56
Using OPENVPN on Ubuntu
sudo apt-get install openvpn
sudo openvpn --config /path/to/config.ovpn