Skip to content

Instantly share code, notes, and snippets.

@tiebingzhang
tiebingzhang / hello.go
Created March 10, 2023 17:54 — forked from vagmi/hello.go
AS2 (RFC 4130) in Golang
package main
import (
"bytes"
"crypto"
_ "crypto/md5" // for crypto.MD5
_ "crypto/sha1" // for crypto.SHA1
_ "crypto/sha512" // for crypto.SHA384 & 512
"crypto/x509"
"encoding/asn1"

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@tiebingzhang
tiebingzhang / maven-install.sh
Created February 7, 2023 21:02
maven install skip pgp and cve
# if you just want to install a jar file
#mvn install:install-file -Dfile=target/myfile-5.6.6.jar -DpomFile=pom.xml
# if you want to install the entire package
mvn install -DskipTests -Dgpg.skip -Ddependency-check.skip=true
@tiebingzhang
tiebingzhang / unionfs-fuse.md
Created June 11, 2021 17:23
unionfs/overlayfs fuse on older kernels (e.g. centos 6)

build it

sudo yum install gcc fuse-devel wget unzip
wget "https://github.com/rpodgorny/unionfs-fuse/archive/refs/heads/master.zip"
unzip master.zip
cd unionfs-fuse-master/
make
sudo make install
ffmpeg -i familymode-kiosk-setup-screencast.mp4 -c:v libx264 -b:v 500k -ab 56k -s 1920x1440 x.mp4
@tiebingzhang
tiebingzhang / udptextd.php
Created July 2, 2020 18:06
An one-off PHP UDP server to listen on a UDP port and print the text received. Can be used as a very basic UDP log listener.
#!/usr/bin/php -f
<?php
error_reporting(~E_WARNING);
//Create a UDP socket
if(!($sock = socket_create(AF_INET, SOCK_DGRAM, 0))) {
$errorcode = socket_last_error();
$errormsg = socket_strerror($errorcode);
die("Couldn't create socket: [$errorcode] $errormsg \n");
}
echo "Socket created \n";
@tiebingzhang
tiebingzhang / extra_hosts
Last active June 24, 2020 14:32
minecraft featured server domains, updated for version 1.16
## Old hosts, just for record
# geo.hivebedrock.network
# hivebedrock.network
# mco.mineplex.com
# mco.lbsg.net
## Current one (as of version 1.16)
play.inpvp.net
mco.cubecraft.net
hivebedrock.us
@tiebingzhang
tiebingzhang / loopback-latency.sh
Created February 25, 2020 00:07 — forked from keturn/loopback-latency.sh
use netem to add latency to loopback network traffic
#!/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
@tiebingzhang
tiebingzhang / firebase-firestore.go
Last active March 21, 2024 01:49
An example Google Firebase Firestore client in Golang, with Create/Update/Read. ** Update the service_account.json file and project-id to yours before running.
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"cloud.google.com/go/firestore"
"google.golang.org/api/option"
@tiebingzhang
tiebingzhang / raw2rsf.c
Created September 9, 2019 00:24
raw2rsf: convert raw sound file (PCM, 8-bit, 8000 samples per second) to LEGO EV3 Sound file (.rsf)
/* See more details at https://tiebing.blogspot.com/2019/09/lego-ev3-sound-file-rsf-format.html */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char **argv){