Skip to content

Instantly share code, notes, and snippets.

@malikperang
malikperang / resize_disk_image.md
Created June 5, 2023 16:11 — forked from joseluisq/resize_disk_image.md
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

@malikperang
malikperang / expose-microk8s-to-lan.sh
Created June 3, 2023 18:30
expose-microk8s-to-lan.sh
## Get cluster info
$ kubectl cluster-info
# Update firewalld
$ sudo firewall-cmd --permanent --zone=public --new-service=microk8s-api --set-description="Microk8s Control Plane API"
$ sudo firewall-cmd --zone=public --new-service=microk8s-api --set-description="Microk8s Control Plane API"
$ sudo firewall-cmd --permanent --zone=public --service=microk8s-api --add-port=16443/tcp
$ sudo firewall-cmd --zone=public --service=microk8s-api --add-port=16443/tcp
$ sudo firewall-cmd --reload
@malikperang
malikperang / .bash_profile
Last active May 22, 2023 13:59
Example Multiple Kube Config files merging
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
alias k="kubectl"
alias microk="microk8s kubectl"
@malikperang
malikperang / killall-openstack-svc.py
Created October 1, 2022 19:34
Stop and Disable OpenStack Service Using Python
#!/bin/python3
import os
import json
tmp_file = "tmp_list.json"
if os.path.exists(tmp_file):
os.remove(tmp_file)
else:
print("Not exists")
@malikperang
malikperang / promise.js
Created August 2, 2021 17:36
JS promise
function abc() {
var promise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve('step 1');
}, 1000);
});
return promise;
}
async function def(){
@malikperang
malikperang / create-db.sql
Last active July 18, 2021 20:49
Parse Server Docker Compose
-- create-db.sql
DROP DATABASE IF EXISTS mydb;
CREATE DATABASE mydb;
@malikperang
malikperang / create-user.js
Last active August 8, 2021 16:35
MongoDB Docker Compose
db.createUser(
{
user: "fariz",
pwd: "admin321",
roles:[
{
role: "readWrite",
db: "admin"
}
]
@malikperang
malikperang / docker-compose.yml
Created March 16, 2021 06:39
PostgreSQL Docker Compose
# Use postgres/example user/password credentials
version: '3.1'
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: example
adminer:
@malikperang
malikperang / docker-compose.yml
Created March 16, 2021 01:33
Jenkins Docker Compose
# docker-compose.yml
version: '3.7'
services:
jenkins:
image: jenkins/jenkins:lts
privileged: true
user: root
ports:
- 8083:8080
- 50003:50000
@malikperang
malikperang / main.yml
Created March 3, 2021 05:33
Contoh Github Action
name: CICD
on: [push,pull_request]
jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
############################