This file contains hidden or 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
import gevent | |
import random | |
from gevent import local | |
from contextlib import contextmanager | |
from tqdm import tqdm | |
# globals | |
stash = local.local() | |
count = lambda: stash.count | |
tasks = [] |
This file contains hidden or 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
from aiohttp.client import ClientSession | |
class CustomClientSession(ClientSession): | |
""" | |
Use proxy on every request when passed to Client | |
Usage | |
>> async with CustomClientSession(proxy="http://1.1.1.1:3128") as session: | |
""" |
This file contains hidden or 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
""" | |
Upload a video to youtube | |
""" | |
import os | |
import time | |
import cookielib | |
import json | |
import requests | |
import mechanize | |
from BeautifulSoup import BeautifulSoup |
This file contains hidden or 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
# It only works if you are accepting users from domain address not ip. Otherwise it will ban all your users. | |
# add this line to /etc/fail2ban/filter.d/freeswitch.conf | |
# in failregex line | |
%(_pref_line)s \[WARNING\] sofia_reg\.c:\d+ SIP auth challenge \(INVITE\) on sofia profile \'internal\' for \[\+?(\d+|\w+)@(?:[0-9]{1,3}\.){3}[0-9]{1,3}\] from ip <HOST>$ |
This file contains hidden or 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
async def setup_database(): | |
global connection_pool | |
connection_pool = await asyncpg.create_pool( | |
user=os.getenv('PGUSER', 'x'), | |
password=os.getenv('PGPASS', 'xx'), | |
database='xx', | |
host='xxx', | |
port=5432 | |
) | |
This file contains hidden or 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
import requests | |
import random | |
import json | |
from bs4 import BeautifulSoup | |
captcha = "03AGdBq25SyMYChQqUZMbWMftzdsGPyK9TztL3q95FoSWY-4042gCR56xovRI3i6i2Son38GjbKVf86X4P-L7GQU_jbZtSK4PwA8zZAPWDNU7FQ-RM1fpnMcUpyxtXOk635UOr2YR_P9Jo5o_72N0OqdCUjDJk6ohOUJPLUy4aAZDHd_oEdfRpmVJpkqCqL2aPtx5BFVqvx9QvQ5wIugNyPk4V3mDVTgxV2_0nieKyLTt92fNr34AeEStL16DQrXk02_zMgKaIHbNE4yYRkJ1Ac0m6Qle3PG_L4ochPAswsdLTgmukolRF8HtZmOU3rJ7F3K4HJ7j4bNBqmf9_KQ3_U-HM2T-MVZiHygJDF4EEg_DL3GsSA8ZGUXRQuk09LKTIfUt6AaNO81ARwCGLQFWbn2-po_K_6GKqkMm5ZxFnu0pWcZeXciJL5nBZDaAYf6YypcrNcWXsw_l4" | |
class NVIScraper: | |
""" NVI address query API |
This file contains hidden or 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
if(permissionCounter == 2) { | |
Intent intent = new Intent(); | |
// context.startActivity(intent); | |
// Intent phoneIntent = new Intent(TelecomManager.ACTION_CHANGE_PHONE_ACCOUNTS); | |
// phoneIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); | |
intent.setComponent(new ComponentName("com.android.server.telecom","com.android.server.telecom.settings.EnableAccountPreferenceActivity")); | |
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |
this.cordova.getActivity().getApplicationContext().startActivity(intent); | |
} else { | |
this.callbackContext.error("You need to accept phone account permissions in order to send and receive calls"); |
This file contains hidden or 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
# https://blog.ropnop.com/configuring-a-pretty-and-usable-terminal-emulator-for-wsl/ | |
[global_config] | |
always_split_with_profile = True | |
focus = system | |
title_inactive_bg_color = "#657b83" | |
title_transmit_bg_color = "#dc322f" | |
[keybindings] | |
switch_to_tab_1 = <Primary>1 | |
switch_to_tab_2 = <Primary>2 |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Original file is the https://gist.github.com/pguillem/5750e8db352f001138f2 | |
This version of the script uses psycopg2 instead of PySQLPool and handles multipart messages | |
""" | |
import sys | |
import pickle | |
from twisted.internet.defer import inlineCallbacks |
This file contains hidden or 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
/* | |
*https://github.com/jackocnr/intl-tel-input | |
*https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/ | |
*/ | |
$('#send_sms_numbers').on('beforeItemAdd', function(event) { | |
// event.item: contains the item | |
// event.cancel: set to true to prevent the item getting added | |
// TR numbers startswith 90 | |
// we also delete 0 at the beginning for our convenience |