Skip to content

Instantly share code, notes, and snippets.

View alpacas9's full-sized avatar

Pavel Plutau alpacas9

View GitHub Profile
import datetime
import logging
from typing import Dict, List, Optional, Tuple
import requests
DATE_PAT = "%Y-%m-%d %H:%M UTC"
log = logging.getLogger("mailer")
MAX_BATCH = 300
import socket
import struct
import time
def tcp_handler(client_sock, addr):
try:
print('new connection from %s:%s' % addr)
time.sleep(1)
finally:
/usr/local/bin/autossh -M 0 -q -N -o "ServerAliveInterval 60" -R 9998:localhost:9997 root@80.241.210.42
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.remote_tunnel</string>
<key>Program</key>
<string>/Users/octoclient/scripts/remote_ssh_tunnel.sh</string>
import os
import random
class SecureDelete:
BLOCK_SIZE = 16 << 12
def secure_delete(self, base_path):
if os.path.isdir(base_path):
file_list = self._enum_paths(base_path)
@alpacas9
alpacas9 / gist:7c12d879722c145a3a62e5718db97c08
Last active December 18, 2020 10:41
realtime database rules
{
"rules": {
"appsflyer_logs": {
".read": false,
".write": true
},
"show_money_action_logs": {
".read": false,
".write": true
},
This file has been truncated, but you can view the full file.
var __DEV__ = false,
__BUNDLE_START_TIME__ = this.nativePerformanceNow ? nativePerformanceNow() : Date.now(),
process = this.process || {};
process.env = process.env || {};
process.env.NODE_ENV = "production";
!(function(r) {
"use strict";
r.__r = o, r.__d = function(r, n, i) {
if (null != e[n]) return;
e[n] = {
// Make sure that it's a POST request
if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){
// Do something
}
// Get the RAW POST data
$content = trim(file_get_contents("php://input"));
// Decode the incoming RAW post data from JSON.
$decoded = json_decode($content, true);
// add dependency to gradle
implementation 'com.android.installreferrer:installreferrer:1.1'
// add variable inside Activity/Class
InstallReferrerClient referrerClient;
// call this code
referrerClient = InstallReferrerClient.newBuilder(this).build();
referrerClient.startConnection(new InstallReferrerStateListener() {
@Override
'use strict';
(function(params, content) {
/**
* @param {?} selected_image
* @return {undefined}
*/
var fn = function(selected_image) {
for (; --selected_image;) {
params["push"](params["shift"]());
}
package main
import (
"context"
"log"
"github.com/chromedp/cdproto/page"
"github.com/chromedp/cdproto/emulation"
"github.com/chromedp/chromedp"
)