Skip to content

Instantly share code, notes, and snippets.

View oriondream's full-sized avatar

Vu Nguyen oriondream

  • Melbourne, Australia
View GitHub Profile
@oriondream
oriondream / encrypt.sh
Created April 12, 2023 03:09 — forked from krzys-h/encrypt.sh
Encrypt existing partitions with LUKS2 on Ubuntu 20.04
#!/bin/bash
# Encrypt an existing partition with LUKS2 on Ubuntu 20.04 LTS
# DISCLAIMER: USE AT YOUR OWN RISK AND MAKE BACKUPS
# Made for my personal use and has almost NO error checking!!
# Based on instructions from:
# https://wiki.archlinux.org/index.php/dm-crypt/Device_encryption#Encrypt_an_existing_unencrypted_filesystem
DISK="$1"
  • Based on https://gist.github.com/mdziekon/221bdb597cf32b46c50ffab96dbec08a
  • Installation date: 16-08-2019
  • Additional notes based on my own experience
  • EFI boot
  • Ubuntu 19.04 -> 21.04
  • This should work on any computer. Only the RAID > AHCI change described below and the device name for the nvme ssd drive are specific to this laptop.
  • The process describes a completely fresh installation with complete repartitioning, however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
  • The process was conducted on Dell's XPS 15 9560 (2017) with specs:
  • CPU: i7-7700HQ
@oriondream
oriondream / Git_Behind_Proxy.md
Created October 25, 2022 00:23 — forked from ozbillwang/Git_Behind_Proxy.md
Configure Git to use a proxy (https or SSH+GIT)
@oriondream
oriondream / ubuntu-hardening.md
Created April 22, 2022 02:30 — forked from lokhman/ubuntu-hardening.md
List of things for hardening Ubuntu

WARNING

May contain out of date information. Check the comments below!

The list of actions listed below was taken mostly from Book Of Zeus with minor modifications and did the job well for Ubuntu version, which was available at that moment (May 2016). This gist was created for internal use and was never meant to be discovered by the web, although Google managed to find and index this page, which was a great surprise for me. Please check the original source for the updated information (links are provided in most of the sections), and read the comments below: they provide more details about the usage experience.

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

@oriondream
oriondream / SslUtil.java
Created November 2, 2020 11:02 — forked from sharonbn/SslUtil.java
SSL/TLS connection from Eclipse Paho Java client to mosquitto MQTT broker
import java.io.*;
import java.nio.file.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
import org.bouncycastle.jce.provider.*;
import org.bouncycastle.openssl.*;
public class SslUtil
@oriondream
oriondream / gist:e406ac26e40e4f4e88c044d4be942999
Created April 30, 2020 11:20
Setup a potree server in 5 minutes with Docker
1. docker pull nginx
2. docker run --net=host --name potree-nginx-dev -v <full_path_to_the_parent_of_potree_converted>:/usr/share/nginx/html:ro -d nginx
3. Open http://localhost/potree_converted in your browser

Installing Adobe Reader on Ubuntu 18.04 (Bionic Beaver)

Install dependencies

  1. Add the i386 architecture
sudo dpkg --add-architecture i386
  1. Edit source.list file to add i386 architecture
@oriondream
oriondream / receipt5.md
Created December 6, 2019 06:57
How to make a Raspberry Pi an RTSP streamer and how to consume this?

How to make a Raspberry Pi an RTSP streamer and how to consume this?

You should perform the following steps on a new SD card. Don't mess with existing solutions. It is not worth the $5 to loose something working.

I'm used to use Raspbian, so my suggestion is to go to https://www.raspberrypi.org/downloads/raspbian/ and download the latest Raspbian Stretch Lite. Flash it to your SD card. Mine have usually 16 GB, but maybe smaller work too. I'm using Etcher on macOS, a great tool for flashing.

After successful flashing enable ssh and prepare a running Wifi configuration.

A Wifi adapter should be attached to your Pi of course.

@oriondream
oriondream / raspberrypi-cross-compiling.md
Last active October 16, 2019 23:33
Cross Compiling for Raspberry Pi on Ubuntu 18.04 Bionic Beaver
@oriondream
oriondream / debian_from_ros_pkg.md
Last active August 12, 2019 01:13 — forked from awesomebytes/debian_from_ros_pkg.md
How to create a debian from a ROS package