Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidArgument</Code><Message>Header value cannot be represented using ISO-8859-1.</Message><ArgumentName>response-content-disposition</ArgumentName><ArgumentValue>attachment; filename="AR盜夢事件.mkv"</ArgumentValue><RequestId>F1D7B3362348CC9B</RequestId><HostId>K3ZV8ZLqYar9OK6GFV+CUvM39OGAzdje8R+F4R7ikaYvWK6m9m1iCnmi/krHciRp89wJYruJ+QI=</HostId></Error>
@ksc91u
ksc91u / pts.py
Last active January 17, 2018 17:01
parse epg xml
#!/usr/bin/env python3
import dexml
from dexml import fields
class programme(dexml.Model):
class meta:
tagname = "programme"
channel = fields.String()
start = fields.String()
stop = fields.String()
@ksc91u
ksc91u / rx.py
Created November 6, 2016 15:10
RxPy
from __future__ import print_function
import rx
import concurrent.futures
import time
seconds = [5, 1, 2, 4, 3]
def sleep(t):
@ksc91u
ksc91u / password.py
Created August 9, 2017 03:12
password of the month
import time
import hashlib
import base64
password="oathkeeper"
date=time.strftime("%m/%Y")
print("password of the month: "+ date)
print(base64.b64encode(hashlib.sha384(password+date).digest())[:40])
@ksc91u
ksc91u / gist:f167a7d56e0c2646c9c8
Last active February 19, 2018 10:21
aapt malformed 9 patch image
#!/bin/bash
enable pwd
args=("$@")
DIR="$(cd "$(dirname "$0")" && pwd)"
case "${args[@]}" in
*".9.png"*)
$DIR/aapt.17 $@
;;
@ksc91u
ksc91u / gist:c3c872679654ec9ebed4
Created July 12, 2015 13:05
Python 3/Python 2 urllib
IS_PYTHON_3=False
try:
import urllib.request as urllib2
IS_PYTHON_3=True
except ImportError:
IS_PYTHON_3=False
import urllib2
curl --verbose "https://preview.wave.com.tw/api/v1/users/103b366c-36d4-49a6-8b9f-41f530a28f36/share_link"
curl --verbose -H "User-Agent: Facebook" "https://preview.wave.com.tw/api/v1/users/103b366c-36d4-49a6-8b9f-41f530a28f36/share_link"
@ksc91u
ksc91u / sum.py
Created November 18, 2020 13:39
python const integer 0-255
#!/usr/bin/env python3
a=5
print(hex(id(a)))
b=2+3
print(hex(id(b)))
c=300
print(hex(id(c)))
@ksc91u
ksc91u / ipset-netflix.sh
Created December 21, 2020 15:29
netflix
www.us-east-1.internal.dradis.netflix.com.
www.us-east-2.internal.dradis.netflix.com.
www.us-west-1.internal.dradis.netflix.com.
www.us-west-2.internal.dradis.netflix.com.
www.eu-west-1.internal.dradis.netflix.com.
www.netflix.com
netflix.com
syntax = "proto3";
package tutorial;
message Person {
enum Corpus {
UNIVERSAL = 0;
WEB = 1;
IMAGES = 2;
LOCAL = 3;
NEWS = 4;
PRODUCTS = 5;