Skip to content

Instantly share code, notes, and snippets.

View adalenv's full-sized avatar
🌐
Worldwide

Adalen Vladi adalenv

🌐
Worldwide
View GitHub Profile
@adalenv
adalenv / sleep.js
Last active November 5, 2018 12:34
function sleep(delayMS) {
var start = new Date().getTime();
while (new Date().getTime() < start + delayMS);
}
[user]
name = adalenv
email = adalenvladi@gmail.com
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
@adalenv
adalenv / mikrotik 2 gateways and separate clients
Created September 20, 2018 14:23 — forked from fanian/mikrotik 2 gateways and separate clients
mikrotik 2 gateways and separate clients
How to add 2 gateways and seperate clients by Chupaka
/ip firewall mangle add chain=prerouting src-address=198.54.15.0/24 action=mark-routing new-routing-mark=r_178
/ip firewall mangle add chain=prerouting src-address=192.168.10.0/24 action=mark-routing new-routing-mark=r_178
/ip firewall mangle add chain=prerouting src-address=192.168.11.0/24 action=mark-routing new-routing-mark=r_172
/ip firewall mangle add chain=prerouting src-address=192.168.12.0/24 action=mark-routing new-routing-mark=r_172
/ip route add gateway=178.242.0.200 routing-mark=r_178
/ip route add gateway=172.16.0.200 routing-mark=r_172
find . -name "*.mp3" -newermt "2016-11-07" ! -newermt "2016-11-07" -exec ls -lh {} \;
dir ext from date to date command
@adalenv
adalenv / test-php-basic-auth.php
Created August 6, 2018 12:12 — forked from rchrd2/test-php-basic-auth.php
PHP basic auth example
<?php
function require_auth() {
$AUTH_USER = 'admin';
$AUTH_PASS = 'admin';
header('Cache-Control: no-cache, must-revalidate, max-age=0');
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW']));
$is_not_authenticated = (
!$has_supplied_credentials ||
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER ||
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS
FOR BUILD 3176
----- BEGIN LICENSE -----
sgbteam
Single User License
EA7E-1153259
8891CBB9 F1513E4F 1A3405C1 A865D53F
115F202E 7B91AB2D 0D2A40ED 352B269B
76E84F0B CD69BFC7 59F2DFEF E267328F
215652A3 E88F9D8F 4C38E3BA 5B2DAAE4
@adalenv
adalenv / phone_nr.py
Created May 22, 2018 15:20
Phone Number Scraper
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Created on 2018-05-18 09:33:05
# Project: test1
from pyspider.libs.base_handler import *
class Handler(BaseHandler):
crawl_config = {
@adalenv
adalenv / uncommitLastCommit.md
Created April 12, 2018 10:01 — forked from alexislucena/uncommitLastCommit.md
Git: How to uncommit my last commit in git

To keep the changes from the commit you want to undo

$ git reset --soft HEAD^

To destroy the changes from the commit you want to undo

$ git reset --hard HEAD^

You can also say

@adalenv
adalenv / vzrebootall.sh
Last active April 6, 2018 09:05
Reboot All Containers (OpenVZ)
for VE in $(vzlist -Ha -o veid); do vzctl restart $VE; done
@adalenv
adalenv / pdocrash.php
Created February 28, 2018 15:48 — forked from bradtraversy/pdocrash.php
PDO & Prepared Statements Snippets
<?php
$host = 'localhost';
$user = 'root';
$password = '123456';
$dbname = 'pdoposts';
// Set DSN
$dsn = 'mysql:host='. $host .';dbname='. $dbname;
// Create a PDO instance