Skip to content

Instantly share code, notes, and snippets.

View LinuxPanda's full-sized avatar
🇮🇳

Kelvin LinuxPanda

🇮🇳
View GitHub Profile
@LinuxPanda
LinuxPanda / f2fs-stable
Created March 30, 2019 19:20 — forked from Nihhaar/f2fs-stable
f2fs merge script
git remote add f2fs https://kernel.googlesource.com/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable
git fetch f2fs
git merge —allow-unrelated-histories f2fs/<branch>
OR
git cherry-pick $(git log --format=oneline --no-merges ..FETCH_HEAD fs/f2fs | tac | cut -d " " -f 1)
@LinuxPanda
LinuxPanda / gist:e36fe6522a1e7a492a5ca291ddd9ab0c
Created October 28, 2018 13:35 — forked from ccopsey/gist:9866a0bcb0b39ade04fe
Rename master branch on GitHub
git branch -m master newname
git push origin newname
# Change "Default Branch" in settings/options in GitHub
git push origin :master
@LinuxPanda
LinuxPanda / encrypt_decrypt
Created January 27, 2015 07:11
File Encryption/Decryption
OpenSSl (Platform Independent)
------------------------------
Encryption: openssl aes-256-cbc -in plain-text.txt -out filename.enc
Decryption: openssl aes-256-cbc -d -in filename.enc -out plain-text.txt
GPG/GnuPG
---------
Encryption: gpg -output filename.gpg --symmetric --cipher-algo AES256 plain-text.txt
# List direcory contents
alias ls='ls -AF --color=auto' # Also show hidden files (without ./ .//) + add / after dirs and @ after link + colored output
alias l='ls -1A' # Show files in one column.
alias ll='ls -lh' # Show human readable.
alias la='ls -lhA' # Show hidden files.
alias lx='ls -lhXB' # Sort by extension.
alias lk='ls -lhSr' # Sort by size, biggest last.
alias lc='ls -lhtcr' # Sort by and show change time, most recent last.
alias lu='ls -lhtur' # Sort by and show access time, most recent last.
alias lt='ls -lhtr' # Sort by date, most recent last.
set tabstop=4 " Number of spaces that a <Tab> in the file counts for.
set shiftwidth=4 " Number of spaces to use for each step of (auto)indent.
set expandtab " Use the appropriate number of spaces to insert a <Tab>.
" Spaces are used in indents with the '>' and '<' commands
" and when 'autoindent' is on. To insert a real tab when
" 'expandtab' is on, use CTRL-V <Tab>.
set smarttab " When on, a <Tab> in front of a line inserts blanks
@LinuxPanda
LinuxPanda / Youtube_Regex_Grab_Video-Playlist_ID_With_Time.php
Last active March 10, 2022 16:10
Best regex pattern to get youtube video/playlist id with/without time from any youtube link and generate embed code. This regex works with 1) youtube & youtu.be 2) http/https 3) with/without www.
<?php
/*
* @gist Regex to get youtube video/playlist id with/without time & generate embed code
* @license UNLICENSE (http://unlicense.org)
*/
$youtube_url = array(
"https://youtu.be/yVpbFMhOAwE",
"https://www.youtube.com/embed/yVpbFMhOAwE",