Skip to content

Instantly share code, notes, and snippets.

View minhng99's full-sized avatar
🤖
Making the world a better place, one bit at a time!

Nguyen Quang Minh minhng99

🤖
Making the world a better place, one bit at a time!
View GitHub Profile
@Akhil-Suresh
Akhil-Suresh / postman_installation.md
Last active April 24, 2024 16:57
Installing Postman on Ubuntu/Debian

Installing Postman

Step 1

If any version of postman is installed we need to remove it

sudo rm -rf /opt/Postman

Step 2

@shamil
shamil / mount_qcow2.md
Last active April 23, 2024 20:24
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@Changaco
Changaco / btrfs-undelete
Last active April 22, 2024 20:06
btrfs-undelete
#!/bin/bash
# btrfs-undelete
# Copyright (C) 2013 Jörg Walter <info@syntax-k.de>
# This program is free software; you can redistribute it and/or modify it under
# the term of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or any later version.
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2
echo
@sinofool
sinofool / install_unifi_8_debian_12.txt
Last active April 2, 2024 09:35
Install Unifi Controller on Debian 11 (Bullseye)
# libssl1.1, the only missing mongodb dependency.
# I prefer enable oldstable in case this get backport security patches
echo "deb http://deb.debian.org/debian bullseye main" | sudo tee /etc/apt/sources.list.d/oldstable-bullseye.list
# MongoDB 4.4, [end of life Feb 2024](https://www.mongodb.com/support-policy/lifecycles)
curl -fsSL https://pgp.mongodb.com/server-4.4.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-4.4.gpg --dearmor
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-4.4.gpg ] http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt-get update && sudo apt-get install mongodb-org-server -y
# Unifi
@benkulbertis
benkulbertis / cloudflare-update-record.sh
Last active March 4, 2024 11:27
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@lifehome
lifehome / README.md
Last active February 25, 2024 06:34 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash

Cloudflare DDNS bash client with systemd

This is a bash script to act as a Cloudflare DDNS client, useful replacement for ddclient.

Look out!

A newer version is available!

This gist will no longer update, instead please go to https://github.com/lifehome/systemd-cfddns for more updated versions.

How to use?

  1. Put the cfupdater files to /usr/local/bin
  • If you are using IPv4 for A record, append -v4 to cfupdater in the following systemd service unit.
@vitali2y
vitali2y / recover_totolink_a850r_thru_realtek_bootloader.md
Created August 2, 2017 20:05
How to recover the firmware on Totolink A850R router thru RealTek bootloader
@elerch
elerch / arch-usb-uefi.md
Last active January 26, 2024 22:20
Installation of Arch Linux on a USB stick with UEFI and legacy BIOS Support

Our goal here is to have one USB stick to rule them all. Objectives:

  • We want a full system - not a live CD
  • We want to boot this system on a Macbook Pro (requires UEFI)
  • We want to boot this system on a Acer C720 Chromebook (requires Legacy BIOS support)
  • We want the system "functional"

The last bullet is subject to interpretation, but I'm defining functional as:

  • X Windows works (with LXDE)
@andelf
andelf / beam_decompile.erl
Created March 19, 2013 03:25
Erlang BEAM file decompile to .erl file
#!/usr/bin/env escript
% -*- mode: erlang -*-
main([BeamFile]) ->
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]),
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
@betrcode
betrcode / README.md
Created June 24, 2014 06:36
Using Python to check if remote port is open and accessible.