Skip to content

Instantly share code, notes, and snippets.

@goophile
goophile / parse_words.py
Last active Nov 25, 2018
Get a list of words from a text file.
View parse_words.py
#!/usr/bin/env python3
import os
import sys
import re
import subprocess
from collections import Counter, OrderedDict
CUR_DIR = os.path.dirname(os.path.realpath(__file__))
@goophile
goophile / iciba-batch-search.py
Created Nov 18, 2018
Search a list of words and sync to iciba cloud.
View iciba-batch-search.py
"""
Search a list of words and sync to iciba cloud.
This script was tested only on Windows 7.
Preparation:
1) Install iciba: http://download.iciba.com/pc/personal2016/PowerWord.800.12012.exe
2) Install python and pyautogui.
3) Move iciba window to a fixed location.
4) Find out the coordinates of text input and search button. Change this script according to your needs.
@goophile
goophile / i8kmon.py
Last active Jul 17, 2016
i8kmon/i8kfan for Dell Precision desktop
View i8kmon.py
#!/usr/bin/python3
import re, subprocess, time
# On my Dell Precision desktop, the `i8kmon` controls the fan level according to the ambient temperature, not the CPU temperature.
# Maybe the i8kutils only works for laptop? I don't know. Luckly, the `i8kfan` CAN control the motherboard fan and CPU fan.
# It's usage is `i8kfan - -`, the first number is for motherboard, the second for CPU. You should test the sequence first.
# What this scirpt do is simple: get temperatures from `sensors`, and change the fan levels with `i8kfan`.
# It's similar to the original TCL version i8kmon.
View loopback-latency.sh
#!/bin/bash
#
# Add latency to all outgoing traffic on $DEV on tcp/udp $PORT,
# in the amount of $DELAY.
#
# This is matching on both source port and destination port, which
# may hit you twice if you're accessing a local resource.
#
# To see what's currently in effect,
# tc -s qdisc show dev lo