View git.migrate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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. |
View git-pull-all
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
View clean_mysql_bin_logs.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker exec -it -u root DB_CONTAINER_NAME /bin/bash | |
mysql -u root -p | |
PURGE BINARY LOGS BEFORE NOW(); # OR RESET MASTER; | |
# check option | |
SELECT * FROM performance_schema.global_variables WHERE VARIABLE_NAME IN ('log_bin'); |
View TextToImage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TextToImage | |
{ | |
/** | |
* @param string $text | |
* @param int $width | |
* @param int $height | |
* @param int $font | |
* | |
* @return Response | |
*/ |
View install_netextender_ubuntu_64_bit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. go to https://sslvpn.demo.sonicwall.com/cgi-bin/welcome | |
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/libssl.so.1.0.0 /usr/lib/libssl.so.6 | |
5. sudo ln -s /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.6 | |
6. un-tar the client, make install script executable and launch install |
View send_to_channel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Send message to slack channel. | |
$hook can be created at https://mindau.slack.com/apps/A0F7XDUAZ-incoming-webhook | |
*/ | |
function sendLog($title, $msg) | |
{ | |
$hook = "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; | |
$data = array( | |
'channel' => '#logging', |
View record.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! 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' |
View read_serial.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
View backup-webserver-db.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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. |
View domain.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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; | |
} |
NewerOlder