Skip to content

Instantly share code, notes, and snippets.

View umardx's full-sized avatar
🏠
Working from home

Umar Nawawi umardx

🏠
Working from home
View GitHub Profile
@umardx
umardx / delete_namespace
Created October 3, 2021 13:41 — forked from hrittikhere/delete_namespace
Delete Terminating Namespace
kubectl get namespace "terminating-namespace" -o json \
| tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \
| kubectl replace --raw /api/v1/namespaces/terminating-namespace/finalize -f -
@umardx
umardx / moment-in-node.js
Created October 23, 2018 07:56 — forked from founddrama/moment-in-node.js
Moment.js examples
// node:
var moment = require('moment');
moment().add('days', 2).fromNow();
// 'in 2 days'
moment().subtract('days', 2).fromNow();
// '2 days ago'
moment('November 1977').fromNow()
@umardx
umardx / softether.sh
Created February 27, 2018 16:00 — forked from bouroo/softether.sh
Install softether vpn server on ubuntu 16.04+
#!/usr/local/env bash
# Update system
apt-get update && apt-get -y upgrade
# Get build tools
apt-get -y install build-essential wget curl
# Define softether version
RTM=$(curl http://www.softether-download.com/files/softether/ | grep -o 'v[^"]*e' | grep rtm | tail -1)
IFS='-' read -r -a RTMS <<< "${RTM}"
@umardx
umardx / vpnclient
Created January 29, 2018 09:40 — forked from legokichi/vpnclient
softether vpn client for ubuntu /etc/init.d/vpnclient
#! /bin/sh
### BEGIN INIT INFO
# Provides: vpnclient
# Required-Start: $all
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VPN Client at boot time
# chkconfig: 345 44 56
# description: Start VPN Client at boot time.
@umardx
umardx / mount_qcow2.md
Created August 11, 2017 06:09 — forked from shamil/mount_qcow2.md
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
@umardx
umardx / golang-nuts.go
Last active June 20, 2017 12:15 — forked from ryanfitz/golang-nuts.go
two ways to call a function every 2 seconds
package main
import (
"fmt"
"time"
)
// Suggestions from golang-nuts
// http://play.golang.org/p/Ctg3_AQisl