Skip to content

Instantly share code, notes, and snippets.

View tamlt2704's full-sized avatar
🎯
Focusing

La Thanh Tam tamlt2704

🎯
Focusing
View GitHub Profile
@htruong
htruong / chroot-to-pi.sh
Last active July 27, 2025 12:36
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@htruong
htruong / raspberry-pi-chroot-armv7-qemu.md
Last active July 22, 2024 14:36 — forked from jkullick/raspberry-pi-chroot-armv7-qemu.md
Chroot into Raspberry Pi ARMv7 Image with Qemu
# raspbian stretch lite on ubuntu

### You can write the raspbian image onto the sd card,
# boot the pi so it expands the fs, then plug back to your laptop/desktop
# and chroot to it with my script 
# https://gist.github.com/htruong/7df502fb60268eeee5bca21ef3e436eb
# sudo ./chroot-to-pi.sh /dev/sdb
# I found it to be much less of a pain in the ass and more reliable
# than doing the kpartx thing
@miglen
miglen / linux-networking-tools.md
Last active November 3, 2025 10:34
Linux networking tools

List of Linux networking tools

netstat (ss)

Displays contents of /proc/net files. It works with the Linux Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options. Netstat (Network Statistic) command display connection info, routing table information etc. To displays routing table information use option as -r.

Sample output:

Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4 0 0 127.0.0.1.62132 127.0.0.1.http ESTABLISHED

Hello World with Spring MVC and Gradle

I am a Ruby and JavaScript developer learning Java. Java-land is vast. There are a number of crufty frameworks and antiquated approaches. Don't get mired in those. Use Spring MVC and Gradle.

What follows is a 'Hello World' application using those Java technologies. Additionally, it does not require the Eclipse IDE which so many other Java tutorials defer to for some reason. I strongly prefer the command line to an IDE.

You can get the finished source of this tutorial here.

Install Gradle

@jasongrout
jasongrout / example.py
Created October 11, 2012 22:12 — forked from mdboom/serve_figure.py
Proof of concept code for serving interactive matplotlib figures to the webbrowser
import serve_figure
import numpy as np
from numpy import ma
from matplotlib import pyplot as plt
n = 12
x = np.linspace(-1.5,1.5,n)
y = np.linspace(-1.5,1.5,n*2)