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 / LPIC-101 400-1
Created January 13, 2021 14:14 — forked from ntwobike/LPIC-101 400-1
Sample questions for LPIC -101-400 part-1
QUESTION 1
Which SysV init configuration file should be modified to disable the ctrl-alt-delete key combination?
A. /etc/keys
B. /proc/keys
C. /etc/inittab
D. /proc/inittab
E. /etc/reboot
QUESTION 2
Which of the following information is stored within the BIOS? (Choose TWO correct answers.)
@malikperang
malikperang / README.md
Created January 10, 2021 08:23 — forked from dalezak/README.md
Ionic Capacitor Resources Generator
  1. Run npm install cordova-res --save-dev
  2. Create 1024x1024px icon at resources/icon.png
  3. Create 2732x2732px splash at resources/splash.png
  4. Add "resources": "cordova-res ios && cordova-res android && node scripts/resources.js" to scripts in package.json
  5. Copy resources.js file to scripts/resources.js
  6. Run sudo chmod -R 777 scripts/resources.js
  7. Run npm run resources
@malikperang
malikperang / list.txt
Created May 15, 2020 14:47 — forked from shortjared/list.txt
List of AWS Service Principals
acm.amazonaws.com
alexa-appkit.amazon.com
apigateway.amazonaws.com
application-autoscaling.amazonaws.com
appstream.application-autoscaling.amazonaws.com
appsync.amazonaws.com
athena.amazonaws.com
autoscaling.amazonaws.com
batch.amazonaws.com
channels.lex.amazonaws.com
@malikperang
malikperang / ls-aws-ami.sh
Created April 28, 2020 19:11 — forked from arpat/ls-aws-ami.sh
List the ten latest ubuntu public images (AMI's) on AWS
# List the ten latest ubuntu public images on AWS
# Output similar to:
# 2017-09-26T16:18:51.000Z ubuntu/images/hvm-ssd/ubuntu-zesty-17.04-amd64-server-20170922 hvm True ami-5cc00825
# 2017-09-21T21:20:20.000Z ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170919 hvm True ami-17d11e6e
# 2017-09-19T10:54:43.000Z ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-20170918 hvm True ami-e872bf91
# 2017-09-05T13:12:32.000Z ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-20170831 hvm True ami-01589c78
# ...etc
aws ec2 describe-images \
--filters Name=name,Values=ubuntu/images/hvm-ssd/ubuntu* \
@malikperang
malikperang / docker-compose.yml
Created September 9, 2019 15:40 — forked from twang2218/docker-compose.yml
HAProxy + Nginx + PHP with client IP attached (don't forget docker daemon option `--userland-proxy=false`)
version: '2'
services:
haproxy:
image: haproxy:alpine
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
ports:
- "80:80"
depends_on:
- nginx
@malikperang
malikperang / PHP composer tools.md
Created September 26, 2018 09:13 — forked from davebarnwell/PHP composer tools.md
Global installation of PHP tools with Composer

Global installation of PHP tools with Composer

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:

$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd
@malikperang
malikperang / extend-subscription-lengths.php
Created March 30, 2018 19:31 — forked from thenbrent/extend-subscription-lengths.php
Add a new billing range to WooCommerce Subscriptions to allow for longer subscription lengths. Specifically a new "36 months" range to allow you to sell a subscription with a length of 36 months.Requires Subscriptions 1.4.4 or newer.
<?php
/**
* Plugin Name: WooCommerce Subscription Length Extender
* Description: Add a custom 36 month subscription length to WooCommerce Subscriptions (requires WC Subscriptions 1.4.4 or newer) to give the option of having a subscription expire after 36 months.
* Author: Brent Shepherd
* Version: 1.0
* License: GPL v2
*/
function eg_extend_subscription_expiration_options( $subscription_lengths ) {
@malikperang
malikperang / install-comodo-ssl-cert-for-nginx.rst
Created November 1, 2017 08:47 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@malikperang
malikperang / docker-gc
Created September 23, 2017 20:58 — forked from osiyuk/docker-gc
free up disk space after docker garbage
#!/bin/bash
GARBAGE="/var/lib/docker/aufs/diff"
du -hd 1 $GARBAGE | sort -hrk 1 | head -25
find $GARBAGE -maxdepth 1 -name *-removing -exec rm -rf '{}' \;