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 / 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/env python
from jsonschema import Draft4Validator, RefResolver
import json
import os
import sys
if len(sys.argv) != 3:
print("Usage: %s <data file> <schema file>" % sys.argv[0])
exit(1)
### Keybase proof
I hereby claim:
* I am Lance0312 on github.
* I am lancechen (https://keybase.io/lancechen) on keybase.
* I have a public key whose fingerprint is F8DA BD84 6787 EBE5 C8CA 58C6 BD3F 87DB 6A0C 53E2
To claim this, I am signing this object:
@lancechentw
lancechentw / flex-partition-table
Last active August 29, 2015 14:03
Arch Linux One Step Installer