Skip to content

Instantly share code, notes, and snippets.

Working from home

Mindaugas Milius grambas

Working from home
View GitHub Profile
grambas / git.migrate
Last active Feb 16, 2022 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
View git.migrate
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
grambas / git-pull-all
Created Feb 16, 2022 — forked from grimzy/git-pull-all
Git pull all remote branches
View git-pull-all
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
grambas /
Last active Nov 2, 2020
cleant mysq bin logs
docker exec -it -u root DB_CONTAINER_NAME /bin/bash
mysql -u root -p
# check option
SELECT * FROM performance_schema.global_variables WHERE VARIABLE_NAME IN ('log_bin');
View TextToImage
class TextToImage
* @param string $text
* @param int $width
* @param int $height
* @param int $font
* @return Response
View install_netextender_ubuntu_64_bit
1. go to
2. log in with demo/password
3. click on NetExtender icon, this will download a tar.gz with the client
4. sudo ln -s /lib/x86_64-linux-gnu/ /usr/lib/
5. sudo ln -s /lib/x86_64-linux-gnu/ /usr/lib/
6. un-tar the client, make install script executable and launch install
View send_to_channel.php
Send message to slack channel.
$hook can be created at
function sendLog($title, $msg)
$hook = "";
$data = array(
'channel' => '#logging',
grambas /
Last active Feb 15, 2019
[ffmpeg] Recodring, streaming, ripping
#! python
# Record stream with python from m3u8 file in 1h parts
import time
import subprocess as sp, sys
import urllib
def record():
sourcePath ='https://url.m3u8'
name = '_video.ts'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" This Module reads data from serial port
then converts to JSON and sends to Amazon Firebase
import serial
from time import sleep
from firebase import firebase
# This bash script exports all mysql databases and archives it with all webserver files.
# Created archive will be encrypted with gpg key.
# After sending to cloud storage all created files will be deleted
# This script uses: tar, gpg, mysql and aws3 s3
# ** IMPORTANT** :
# ** You need to have generated gpg key !!! Otherwise comment encryption part.
# ** Execute this script with proper rights. It means that if in webserver dir
# you have files with permisions only for root user, then use sudo.
grambas / domain.conf
Last active Jan 21, 2019
[Webserver Security]
View domain.conf
# Common bandwidth hoggers and hacking tools.
map $http_user_agent $limit_bots {
default 0;
~*(AltaVista|Slurp|BlackWidow|Bot|ChinaClaw|Custo|DISCo|Download|Demon|eCatch|EirGrabber|EmailSiphon|EmailWolf|SuperHTTP|Surfbot|WebWhacker) 1;
~*(Express|WebPictures|ExtractorPro|EyeNetIE|FlashGet|GetRight|GetWeb!|Go!Zilla|Go-Ahead-Got-It|GrabNet|Grafula|HMView|Go!Zilla|Go-Ahead-Got-It) 1;
~*(rafula|HMView|HTTrack|Stripper|Sucker|Indy|InterGET|Ninja|JetCar|Spider|larbin|LeechFTP|Downloader|tool|Navroad|NearSite|NetAnts|tAkeOut|WWWOFFLE) 1;
~*(GrabNet|NetSpider|Vampire|NetZIP|Octopus|Offline|PageGrabber|Foto|pavuk|pcBrowser|RealDownload|ReGet|SiteSnagger|SmartDownload|SuperBot|WebSpider) 1;
~*(Teleport|VoidEYE|Collector|WebAuto|WebCopier|WebFetch|WebGo|WebLeacher|WebReaper|WebSauger|eXtractor|Quester|WebStripper|WebZIP|Wget|Widow|Zeus) 1;
~*(Twengabot|htmlparser|libwww|Python|perl|urllib|scan|Curl|email|PycURL|Pyth|PyQ|WebCollector|WebCopy|webcraw) 1;