Skip to content

Instantly share code, notes, and snippets.

import time
import re
from datetime import datetime
DATE_REGEX = re.compile(r"(.*?) dnsmasq\[.*?\]:.*$")
FORWARDED_REGEX = re.compile(r".*: forwarded (.*?) to (.*?)$")
QUERY_REGEX = re.compile(r".*: query\[(.*?)\] (.*?) from (.*?)$")
REPLY_REGEX = re.compile(r".*: reply (.*?) is (.*?)$")
CACHE_HITS_REGEX = re.compile(r".*: queries forwarded (\d+), queries answered locally (\d+)$")
QUERIES_REGEX = re.compile(r".*: server .*?: queries sent (\d+), retried or failed (\d+)$")
Section -VCRedist
call installVC
SectionEnd
Section -Webview2
call installWebView2
SectionEnd
Section -DotNet
call installDotNet
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import re
sites=[]
dirver = webdriver.Chrome()
def load_page(site):
package netns
import (
"regexp"
"strconv"
"strings"
"dev.azure.com/raisether/raisether/_git/raisether/pkg/utils"
"dev.azure.com/raisether/raisether/_git/raisether/raisether/jet/models"
)
{
"version": "1.0",
"product": "cor",
"update_at": "2021-04-05 10:10:10",
"rules": [
{
"name": "china",
"datapath": 0,
"items": [
"114.114.114.114/255.255.255.255"
on run
--edit this to be the correct location and file to run (typically only edit after the "drive_c")
set toRun to "$WINEPREFIX/drive_c/Program Files/vpnmgr/vpnsmgr_x64.exe"
--edit winePrefix if you are not using the default prefix
set winePrefix to "$HOME/.wine"
--edit wineLocation if your wine install is not the default location
set wineLocation to "/usr/local/bin"
https://press.one/p/address/v?s=cf1a60ab5f7175febd72d2571f931e870eacbb879cf3b0d277473cc441c37978cc7310cc35deee18ca23099b5fe7b33d61e8df3ecef1f2fa883f96d8467c89ba1&h=90a69a34e748a8f5400af3b8fee114d22a0c13d8b9a5199c56732b1aa84f4e2f&a=e14e44c3ece9a42a0d3ce13d4f1f96345c452154&f=P1&v=2
@onetown
onetown / app.py
Created June 21, 2018 12:17
app.py
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
from flask import Flask
from redis import Redis
app = Flask(__name__)
redis = Redis(host='localhost', port=6379)
@app.route('/')
@onetown
onetown / gist:303e5b15a8a6ac9ac041
Created June 29, 2015 07:31
openstacknetsdk sample code
using System;
using System.Collections.Generic;
// step 1
using net.openstack.Core.Domain;
using net.openstack.Core.Providers;
using net.openstack.Providers.Rackspace;
namespace openstack.firstapp
{
class MainClass
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import re
import logging
import random
import pymongo
import datetime
import tornado.httpserver
import tornado.options