Skip to content

Instantly share code, notes, and snippets.

@TheBits
TheBits / cudo.json
Created March 5, 2024 14:06
cudo.json
{
"request": {
"cpuModel": "",
"gpu": 1,
"gpuModel": "",
"gpuModelId": "",
"memoryGib": 1,
"orderBy": "",
"pageNumber": 0,
"pageSize": 0,
package main
import (
"fmt"
"github.com/aead/siphash"
"encoding/hex"
)
func main() {
key, _ := hex.DecodeString("00000000000000000000000000000001")
git diff -- util
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
modified: util/datetime/cputimer.cpp
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@ util/datetime/cputimer.cpp:17 @
#include <sys/resource.h>
#include <sys/param.h>
#if !defined(_cygwin_) && !defined(_android_)
#include <sys/sysctl.h>
#endif
@TheBits
TheBits / osm.js
Last active January 5, 2019 14:11
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"accuracy": 0.001,
"address": "Садовая улица, городское поселение Лесной Городок, Одинцовский район, Московская область, ЦФО, 143072, РФ",
"bbox": [
37.1899249,
hex win_name linux_name
0 0 READ read
1 1 WRITE write
2 2 OPEN open
3 3 CLOSE close
4 4 STAT64 stat
5 5 FSTAT64 fstat
6 6 LSTAT64 lstat
7 7 POLL poll
8 8 LSEEK lseek
{
"code": null,
"site": {
"id": "hh",
"name": "hh.ru"
},
"published_at": "2015-08-18T18:19:28+0300",
"accept_handicapped": false,
"key_skills": [],
"employment": {
#!/usr/bin/env bash
# select "name" from animals_vpnaccount where id in (select vpnaccount from animals_homertunnel where isptunnel in (select id from animals_isptunnel where account in (select id from animals_ispaccount where isp in (select id from animals_isp where name = 'NetByNet')))) order by name;
while read p
do
echo $p
# проверка
curl -w "size: %{size_download}\n\n" -o /dev/null -m 10 -L -x 'botanik.yandex.net:4050' -H "Forward-Via: $p" --silent 'http://static.yandex.net/ok.html' -vv 2>&1 | grep -iE "GET.*HTTP/|Host:|size:"
#FUNCTION x509_get_info(pem character varying)
# old
from gnutls.crypto import X509Certificate
x=X509Certificate(pem.replace('\r ', '\r\n'))
subj = dict([f.split('=') for f in x.subject.split(',')])
from datetime import datetime
return subj['CN'], datetime.fromtimestamp(x.expiration_time)
#new
@TheBits
TheBits / gist:10020584
Created April 7, 2014 13:46
Periodic call
import threading
import time
class Ti(threading.Thread):
def __init__(self):
print('inittt')
self.k = 1
self.t = None
super().__init__()
@TheBits
TheBits / PKGBUILD
Created December 17, 2013 20:30
archlinux python2-gnutls 1.2.5 patch
# $Id: PKGBUILD 74655 2012-08-01 13:54:20Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Hugo Doria <hugo@archlinux.org>
# Contributor: N3RD3X <n3rd3x@linuxmail.org>
pkgname=python2-gnutls
pkgver=1.2.5
pkgrel=2
pkgdesc="Python wrapper for the GNUTLS library"
arch=('i686' 'x86_64')