Skip to content

Instantly share code, notes, and snippets.

@xiconet
xiconet / cloudflare.go
Last active March 28, 2020 14:01
cloudflare under-attack mode challenge solver
package scraper
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
@xiconet
xiconet / hitail.go
Last active May 27, 2018 21:30
Hightail (formerly Yousendit) basic console client in golang
package main
import (
"bytes"
"encoding/json"
"fmt"
"github.com/alexflint/go-arg"
"github.com/cheggaaa/pb"
"github.com/nu7hatch/gouuid"
"github.com/xiconet/utils"
@xiconet
xiconet / dboxapi.go
Last active March 31, 2018 22:53
Dropbox APIv2 client in golang
// Command dbox is a client for the dropbox "rest" API
package main
import(
"os"
"os/exec"
"time"
"net/http"
"net/url"
"io"
@xiconet
xiconet / pcurl.py
Last active April 21, 2021 06:24
pycurl quickstart
#!C:/Python36/python
#
# from http://pycurl.io/docs/latest/quickstart.html#retrieving-a-network-resource
from io import BytesIO
from urllib.parse import urlencode
import posixpath
import re
import json
import pycurl
@xiconet
xiconet / Git Bash.vbs
Created May 19, 2017 18:34 — forked from markrendle/Git Bash.vbs
Modified Git Bash to use Console2
Set AppObj = CreateObject("Shell.Application")
If WScript.Arguments.Length=1 Then
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash"" -d """ & WScript.Arguments(0) & """"
Else
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash"""
End If
@xiconet
xiconet / good.pl
Last active April 21, 2021 06:25
good is a gdrive client in perl
#!/usr/bin/env perl
#
# my own little google drive client written in perl
#
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
@xiconet
xiconet / utils.py
Last active May 8, 2017 15:44
Collected python utilities
#!/usr/bin/env python
"""Collect utilities here
__VERSION: 0.1
__AUTHOR: xiconet
"""
MAXLEN = 60
START_AT = 2
@xiconet
xiconet / chksums.sh
Created January 9, 2017 19:03
Checksum one-liners.
# bourne shell functions below take 1 argument, the file_to_hash.
# prints hex digest on stdout
md5() {
perl -MDigest::MD5=md5_hex -le'print md5_hex(<> or die)' "$1"
# ruby -rdigest/md5 -e"puts Digest::MD5.file'/dev/null'"
# python -sBc "import hashlib;print hashlib.md5(open('$1','rb').read()).hexdigest()"
# md5 "$1"|cut -d' ' -f4 # mac
# md5sum "$1"|cut -d' ' -f1 # linux
# openssl md5 "$1" | grep -o '[[:xdigit:]][[:xdigit:]]*$' | cat
@xiconet
xiconet / web-servers.md
Created January 5, 2017 10:32 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@xiconet
xiconet / piped_upload.go
Last active October 25, 2015 03:43 — forked from cryptix/client.go
multipart upload with io.Pipe
package main
import (
"io"
"log"
"mime/multipart"
"net/http"
"os"
"path/filepath"
"runtime"