Skip to content

Instantly share code, notes, and snippets.

Ubuntu Server ICS

  1. Install Network Manager: sudo apt-get install network-manager
  2. Allow it to manage the system networking: https://askubuntu.com/a/842843
  3. Configure your interface (enp37s0f0 = lan in this example):
nmcli c add con-name upstairs type ethernet ifname enp37s0f0 ipv4.method shared ipv6.method ignore
nmcli c up upstairs
  1. Ensure ufw doesn't drop forwarded connections: https://superuser.com/a/1819224
  1. Install Stylus: https://addons.mozilla.org/en-US/firefox/addon/styl-us/

  2. Select manage styles from extension:

    Screenshot 2023-10-21 at 19 25 46
  3. Call the style "KEATS Userstyle"

  4. Select "write new style" then click on "import" and paste the keats-userstyle.css file below. Select "override style", then save the style.

  5. Subscribe to this Gist for updates

@insertish
insertish / .bashrc
Last active April 25, 2024 11:05
Ubuntu 20.04 + ROS Noetic + TIAGo
# ROS Noetic + TIAGo workspace
source /opt/ros/noetic/setup.bash
source /home/ubuntu/tiago_public_ws/devel/setup.bash
# Try to determine appropriate ROS_IP based on network interfaces
export ROS_IP=$(ip addr | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p' | head -n 1)
echo ROS_IP set to $ROS_IP
# Switch to and configure LASR workspace
alias lasr="cd /media/ubuntu/c26792b8-9486-4e51-8b3d-b8577a6bbf28/lasr_ws && source devel/setup.bash"
@insertish
insertish / discord gif picker export.js
Created April 25, 2023 13:17
Export GIFs from Discord GIF favourites
// Open GIF picker
// Then run:
(() => {
let links = new Set();
function capture() {
const elements = [
...document.querySelectorAll("#gif-picker-tab-panel img"),
...document.querySelectorAll("#gif-picker-tab-panel video")
];
@insertish
insertish / 1. macOS Keyboard Modifications.md
Last active April 27, 2023 12:40
macOS Keyboard Modifications

There is one Karabiner file you need to apply which is 2. pc_shortcuts.json, this is copied from https://ke-complex-modifications.pqrs.org/#pc_shortcuts.

After applying these, manually change settings below.

Settings

Enable normal function keys under "Keyboard Shortcuts" -> "Function Keys".

@insertish
insertish / Gazebo Blender.md
Last active January 11, 2023 15:17
Create scenes in Blender then import them into Gazebo.
#!/bin/fish
# convert the PDF into a sequence of images
# pick input filename
set PDF_NAME abc.pdf
# you may need to experiment with density to find the correct resolution
set DENSITY 300
convert -density $DENSITY -quality 100 $PDF_NAME seq.png
# convert the sequence of images into a GIF
@insertish
insertish / React Native.md
Last active April 18, 2024 21:28
Configure React Native with Typescript, Vite.js for react-native-web and Storybook.
@insertish
insertish / do the thing.sh
Created February 12, 2022 15:06
Combine all video files in a directory into one.
ls -w 1 > list && sed -i -e 's/^list$//' list && sed -i -e 's/^\(.\+\)$/file \'\1\'/' list && cat list && ffmpeg -f concat -safe 0 -i list -c copy output.mp4
@insertish
insertish / anonymise.js
Last active October 14, 2021 21:17
Randomise your Steam purchases for safely fucking with scammers.
[...document.querySelectorAll('.wallet_table_row')]
.map(x => {
if (x.querySelector('.wht_items').innerText.includes('£')) return x.parentElement.removeChild(x);
let amount = (Math.random() * 20).toFixed(2);
x.querySelector('.wht_total').innerText = "£" + amount;
x.querySelector('.wht_wallet_change').innerText = "-£" + amount;
x.querySelector('.wht_wallet_balance').innerText = "£0.00";
});
[...document.querySelectorAll('.wth_payment')].map(x => x.innerText = 'Visa **37');