Skip to content

Instantly share code, notes, and snippets.

# USAGE llog write to console
llog() {
echo "$(date '+%Y-%m-%d %H:%M:%S%s') $(printf ' %q' "$@")"
}
@miztiik
miztiik / download_video_using_youtube_dl.md
Last active June 14, 2020 19:45
how to use youtube-dl

Download Video using youtube_dl

O_VID_FORMAT="mp4"
VID_URL="https://www.youtube.com/watch?v=jKPlGznbfZ0"

youtube-dl -f bestvideo+bestaudio --merge-output-format $O_VID_FORMAT $VID_URL

# For getting MP4 version
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' $VID_URL

Simple echo container

docker run --name test -d busybox sh -c "while true; do $(echo date); sleep 1; done"
@miztiik
miztiik / .gitignore
Created February 13, 2020 23:17
Sample .gitignore file for AWS CDK Python projects
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
function isHidden(el) {
if(el) return (el.offsetParent === null);
else return false;
}
TotalUnfollowed = 0;
var LoadingAnimation = document.getElementsByClassName("initial-load-animation")[0];
var CatchLoadingAnimation = setInterval(function(){
if(isHidden(LoadingAnimation) == true) {
from botocore.credentials import RefreshableCredentials
from botocore.session import get_session
from boto3 import Session
def assumed_session(role_arn, session_name, session=None):
"""STS Role assume a boto3.Session
With automatic credential renewal.
@miztiik
miztiik / add-multiple-remotes-to-git-repo.md
Last active July 12, 2024 15:30
Adding multiple remote url to git repo

Add Multiple Remotes URLs to git

Adding the first remote origin

git remote add origin remote_1_url
git remote set-url origin remote_1_url

# Set the default remote branch for the current local branch
git branch --set-upstream master
# or
yum -y install epel-release deltarpm wget \
&& yum -y update \
&& yum -y install net-tools bind-utils zip git
# Setup the Repo for Python 3
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install python36u
yum -y install python36u-pip
python3.6 -V
@miztiik
miztiik / repo-reset.md
Created December 3, 2018 22:27 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@miztiik
miztiik / motd.sh
Created October 31, 2018 15:08
friendly MOTD readme
echo "
_____________________________
|| ||
|| Welcome to Valaxy Demo ||
||_____________________________||
|| ||
|| _nnnn_ ||
|| dGGGGMMb ||
|| @p~qp~~qMb ||
|| M|@||@) M| ||