Skip to content

Instantly share code, notes, and snippets.

View kmkmjhyiiiu's full-sized avatar
🎯
Focusing

... kmkmjhyiiiu

🎯
Focusing
  • Galaxy X
View GitHub Profile
@kmkmjhyiiiu
kmkmjhyiiiu / setup.sh
Created October 11, 2022 19:05
Setup Docker and docker-compose
#!/bin/sh
set -e
# Docker CE for Linux installation script
#
# See https://docs.docker.com/engine/install/ for the installation steps.
#
# This script is meant for quick & easy install via:
# $ curl -fsSL https://get.docker.com -o get-docker.sh
# $ sh get-docker.sh
#
@kmkmjhyiiiu
kmkmjhyiiiu / smtp-test.py
Last active June 13, 2022 17:28 — forked from miohtama/smtp-test.py
Testing SMTP server from command line using python
# skipped your comments for readability
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
me = ""
my_password = r""
you = ""
msg = MIMEMultipart('alternative')
@kmkmjhyiiiu
kmkmjhyiiiu / run_command_one_sec.sh
Last active January 26, 2021 12:27
Run artisan command every second
#!/usr/bin/env bash
cd "/var/sunlounge/prod";
while true; do
echo "Running Command:";
php artisan route:call api/vipps/poll;
echo "Done!";
sleep 1
done;
@kmkmjhyiiiu
kmkmjhyiiiu / install.sh
Last active January 5, 2021 21:43 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@kmkmjhyiiiu
kmkmjhyiiiu / default.conf
Created December 1, 2020 09:01
django proxy pass apache conf
<VirtualHost *:80>
ServerAdmin admin@productdemo.biz
ServerName lms.productdemo.biz
ServerAlias www.lms.productdemo.biz
#DocumentRoot /var/www/html/lms
ProxyPass / http://0.0.0.0:8000/
ProxyPassReverse / http://0.0.0.0:8000
ErrorLog ${APACHE_LOG_DIR}/error.log
@kmkmjhyiiiu
kmkmjhyiiiu / bash.sh
Created September 16, 2020 02:38
kill localhost php
sudo kill -9 $(lsof -t -i:8001 -sTCP:LISTEN)
@kmkmjhyiiiu
kmkmjhyiiiu / ahref-click-refresh-btn.js
Created July 12, 2020 10:34
it clicks at refresh buttons when we perform search and results are return
let btns = document.querySelectorAll('.actionsCell-button');
for(var i=0; i < btns.length; i++){
btns[i].click();
}
@kmkmjhyiiiu
kmkmjhyiiiu / pre-commit
Last active April 3, 2020 07:33
my favourite first githook before comitting
#!/bin/sh
# Output colors
red='\033[0;31m';
green='\033[0;32m';
yellow='\033[0;33m';
default='\033[0;m';
bold=$(tput bold);
# current branch name.
ffmpeg -i /code/data/test/video_editor/ffmpeg-video-encoder-sample.mkv -i /code/data/watermark-logo.png -filter_complex "[0]subtitles=/code/data/test/video_editor/ffmpeg-video-encoder-sample.mkv:si=6[v];[1][v]scale2ref=w='iw*10/100':h='ow/mdar'[wm][vid];[vid][wm]overlay=10:10" -map "0:a:1" -c:v libx264 -preset ultrafast /code/data/test/video_editor/audio_and_subtitle.mp4
@kmkmjhyiiiu
kmkmjhyiiiu / gender_api.py
Created August 7, 2019 11:34
Gender Api module for python
from urllib.parse import urljoin
from requests import Session, Response
class InvalidGenderApiResponse(Exception):
"""
Exception class if in cause response is not ok from gender api.
"""