Skip to content

Instantly share code, notes, and snippets.

@psigen
psigen / useful-bash-oneliners.md
Last active August 13, 2023 14:11
Useful bash one-liners
# Show a list of Ubuntu packages that are marked as manually installed
# See: https://askubuntu.com/a/492343
comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u)
@psigen
psigen / .Minecraft_Server.md
Last active March 28, 2020 22:29
Minecraft Server Setup (Linux)

Minecraft Server Setup

This is a pair of bash scripts that can be installed on an Ubuntu server to bootstrap a working minecraft server. They are designed to be run with root permissions.

  • server.sh - bootstrap the creation of a service that runs the minecraft server
  • console.sh - connect to the console of a running server using screen
@psigen
psigen / DataExport.ipynb
Created August 25, 2016 17:03
Exporting logfile data to CSV.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@psigen
psigen / verify_firebase_token.py
Created August 1, 2016 06:07
Google App Engine compatible server-side Python token-verification for Firebase 3.
def base64url_decode(s):
""" Decode base64 encoded strings with stripped trailing '=' """
import base64
return base64.urlsafe_b64decode(s + '=' * (-len(s) % 4))
def unpack_jwt_token(token):
""" Splits and decodes a JWT into a header, payload and signature. """
import json
encoded_header, encoded_payload, encoded_signature = token.split('.')
@psigen
psigen / VehicleTunnelService.java
Last active November 20, 2015 19:17
Vehicle Tunnel Service
package com.platypus.com.platypus.crw.udp;
import com.platypus.crw.udp.UdpConstants;
import com.platypus.crw.udp.UdpServer;
import com.platypus.crw.udp.UdpServer.Request;
import java.io.IOException;
import java.net.*;
import java.util.Collection;
import java.util.HashMap;
@psigen
psigen / Main.java
Created November 18, 2015 16:07
Registry Test Application
package com.platypus;
import com.platypus.crw.FunctionObserver;
import com.platypus.crw.udp.UdpVehicleServer;
import com.platypus.crw.udp.UdpVehicleService;
import com.platypus.crw.udp.VehicleRegistryService;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
@psigen
psigen / Main.java
Created November 18, 2015 16:07
Registry Test Application
package com.platypus;
import com.platypus.crw.FunctionObserver;
import com.platypus.crw.udp.UdpVehicleServer;
import com.platypus.crw.udp.UdpVehicleService;
import com.platypus.crw.udp.VehicleRegistryService;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
@psigen
psigen / empty.iv
Created April 6, 2015 14:10
Invalid empty geometry placeholder for OR_RVIZ
#Inventor V2.0 ascii
Separator {
Info {
string "empty.iv generated by IVCON."
string "Original data in file NO_IN_NAME."
}
Separator {
LightModel {
model PHONG
@psigen
psigen / gist:f378064818577ab9309b
Created January 30, 2015 22:18
TSR visualization psuedocode
# Compute the base to gripper offset for the robot.
T0_e = robot.GetLink('grasp_frame').GetTransform()
T0_b = robot.GetTransform()
Te_b = numpy.dot(numpy.linalg.inv(T0_e), T0_b)
# Turn off everything except things named 'gripper'!
# Autoscale the window by initially centering the gripper.
for link in robot.GetLinks():
if 'gripper' not in link.GetName():
link.SetVisible(False)
+==============
+ 2
+ ===========
+ =========
+ \
========= \
\\ \
=========// /
2 /
=============/