Skip to content

Instantly share code, notes, and snippets.

@lancechentw
lancechentw / equipment_scrapes.csv
Created October 4, 2023 06:52
Plot subplots grouped by a pandas dataframe column
We can't make this file beautiful and searchable because it's too large.
time,equipment_id,produced_quantity,data
2023-10-03 00:00:00+00,eq1,0.00,
2023-10-03 00:00:10.064+00,eq1,0.00,
2023-10-03 00:00:20.612+00,eq1,0.00,
2023-10-03 00:00:30.045+00,eq1,0.00,
2023-10-03 00:00:40.93+00,eq1,0.00,
2023-10-03 00:00:51.775+00,eq1,0.00,
2023-10-03 00:01:01.703+00,eq1,0.00,
2023-10-03 00:01:11.148+00,eq1,0.00,
2023-10-03 00:01:20.897+00,eq1,0.00,
@lancechentw
lancechentw / variable_vel.src
Created November 8, 2022 10:03
KUKA SLIN variable velocity
&ACCESS RVP
&REL 5
&PARAM EDITMASK = *
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM DISKPATH = KRC:\R1\Program
DEF lance( )
int errorcode
decl axis joint_pos_tgt
struc TRAJ_PT_TYP axis joint_pos, real velocity
decl TRAJ_PT_TYP traj_pts[61]
// Change the viewport temporarily, use browser's developer console to
// decide what width would fit your content to a A4 size pdf better.
// You will probably need to redesign the layout of your website under this breakpoint.
document.querySelector("meta[name=viewport]").setAttribute("content", "width=1000px");
// I have 2 Chart.js objects on my website, and they work bad under
// this viewport, so I am resizing them. You could probably do similar
// thing to your images here.
if (temperatureChart && pressureChart) {
temperatureChart.resize(640, 320);
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 10: htb default 256
tc class add dev eth0 parent 10: classid 10:1 htb rate 100mbit ceil 100mbit
tc class add dev eth0 parent 10:1 classid 10:10 htb rate 300kbit ceil 300kbit prio 1
tc qdisc add dev eth0 parent 10:10 handle 101: sfq perturb 10
tc filter add dev eth0 parent 10: protocol ip prio 10 handle 1 fw classid 10:10
# Limit speed of downloading to 192.168.1.100
iptables -t mangle -A POSTROUTING -d 192.168.1.100 -j MARK --set-mark 1
iptables -t mangle -A POSTROUTING -d 192.168.1.100 -j RETURN
apt-get update
apt-get install libexpat-dev
ln -s /usr/lib/x86_64-linux-gnu/libexpat.so /usr/lib/libexpat.so
su - builder -c "
mkdir -p build \
&& cd build \
&& ct-ng arm-unknown-linux-gnueabi \
&& ct-ng build"
@lancechentw
lancechentw / lance.asc
Last active April 6, 2016 03:09
My PGP Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFE+4NkBCADpGzVHUnVWD7z0VDeKsXC0A8cN4i5E5ejl1+XTVuOsR+MrbJc/
d+YkkETWXwsZLLo2t0C7rurB0wiUuoTRvnzoigoPh2R4QAp/iykcfit91hNF/mxg
9JXonxh4+5u48DgDUHib9AdkIe4sK706DvjC2ZQjyirbzOPg1jdcK8EzELG4J3tb
1yqwQ4Edq9d2w5hduWEZJi90PptG+q4gZFcXksLDx4F4/wppcraG5g0+8qZciuV2
9rlAdTlY8ZTIClD/VzRSapEAJp9l6Td4phf4o0oYAxPW4GJQDdU/1m+iq0/o3om9
tLzwD9oko2DTgSe3nhSzLZRpatDA9U8e/cMVABEBAAG0H0xhbmNlIENoZW4gPGN5
ZW4wMzEyQGdtYWlsLmNvbT6JATwEEwECACYCGwMHCwkIBwMCAQYVCAIJCgsEFgID
@lancechentw
lancechentw / inside.c
Created January 2, 2016 04:33 — forked from stephenR/inside.c
32c3 docker exploit
#include <sys/socket.h>
#include <sys/un.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static void err_quit(const char * const msg) {
puts(msg);
exit(-1);
}
██████████████████████████████████████████████████████████████
██ ██ ██████ ██ ████ ██
██ ██████████ ██ ██ ████ ████ ██████ ██████████ ██
██ ██ ██ ████ ██ ██████ ██ ██ ██ ██ ██
██ ██ ██ ██ ████ ██ ████ ██ ████ ██ ██ ██
██ ██ ██ ████ ████ ██ ██ ████ ██ ██ ██
██ ██████████ ████ ████ ████ ██ ██████████ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████████████████ ████ ████████████████████
██ ██ ██ ████ ██ ██ ██████ ████ ██ ██
#!/usr/bin/python
# coding: utf-8
"""
qr - Convert stdin (or the first argument) to a QR Code.
When stdout is a tty the QR Code is printed to the terminal and when stdout is
a pipe to a file an image is written. The default image format is PNG.
"""
import sys
import optparse