Skip to content

Instantly share code, notes, and snippets.

🎯

Louie Lu mlouielu

🎯
Block or report user

Report or block mlouielu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mlouielu
mlouielu / purify.py
Last active Jul 28, 2019
BibTex Field Purify
View purify.py
# -*- coding: utf-8 -*-
#
# BibTeX Purify
#
# Description
# This script will purify the BibTex file's fields and *overwrite* it
#
# Usage
# $ ./purify.py filename [filenames...]
#
View try_ssh.md

115.159.111.193 151.80.140.13 152.136.40.218 159.65.12.204 159.65.30.66 181.111.181.50 181.123.9.3 181.84.99.212 187.65.164.143 190.190.215.114

View test.py
import requests
URL = 'http://www.twse.com.tw/exchangeReport/MI_INDEX?response=csv&date=20181218&type=ALL'
def main(url):
r = requests.get(url)
with open('test.csv', 'w') as f:
f.write(r.text)
View test.py
import requests
URL = 'http://www.twse.com.tw/exchangeReport/MI_INDEX?response=csv&date=20181218&type=ALL'
def main(url):
r = requests.get(url)
with open('test.csv', 'w') as f:
f.write(r.text)
View stack_heap.c
#include <stdio.h>
#include <stdlib.h>
int c = 0xffffeeee;
int main() {
int a = 0x12345678;
int b = 0xdeadbeaf;
int *d = malloc(sizeof(int));
int *e = malloc(sizeof(int));
printf("%p %p %p %p %p\n", &a, &b, &c, d, e);
@mlouielu
mlouielu / paging_features_cpuid.c
Created Oct 15, 2018
Get Intel 64/IA-32 architecture paging features by CPUID
View paging_features_cpuid.c
/*
* Get Intel 64/IA-32 architecture paging features by CPUID
*
* Ref: Intel® 64 and IA-32 architectures software developer's manual
* combined volumes 3A, 3B, 3C, and 3D: System programming guide,
* pp.Vol. 3A 4-5 (Section 4.1.4 Enumeration of Paging Features by CPUID
*/
#include <stdio.h>
#include <stdlib.h>
View 403-ath-regd-optional.patch
From bdd191931f8948c80020138c06aaebd10ca9ffcb Mon Sep 17 00:00:00 2001
From: Louie Lu <git@louie.lu>
Date: Sun, 7 Oct 2018 12:36:47 +0800
Subject: [PATCH] ath: Bypass EEPROM regd
---
drivers/net/wireless/ath/regd.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
View mops.py
import requests
from lxml import etree
r = requests.post('http://mops.twse.com.tw/mops/web/ajax_t93sc01_1', {'encodeURIComponent': 1, 'step': 1, 'firstin': 1, 'off': 1, 'TYPEK': 'sii'})
r.encoding = 'utf-8'
root = etree.HTML(r.text)
for r in root.xpath('//tr')[2:]:
print(list(r.itertext()))
View gear360_linux
$ ls
360_0926.MP4 gear360pano spatial-media tmp
# 將影片轉為魚眼圖片
$ ffmpeg -y -i 360_0926.MP4 -q:v 2 tmp/image%05d.jpg
# 將魚眼圖片轉為拼接圖片
$ find tmp -type f -name '*.jpg' | parallel --load 99% --noswap --memfree 500M --bar "gear360pano/gear360pano.sh -r -m -o tmp {} gear360pano/gear360video4096.pto"
# 將拼接圖片轉為影片
View a.py
while True:
w, v = input().split(',')
if w.find('-') ^ v.find('-'):
break
print('input error')
You can’t perform that action at this time.