Skip to content

Instantly share code, notes, and snippets.

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

Ammly Ammly

🏠
Working from home
View GitHub Profile
@Ammly
Ammly / enable-hibernate-arch-linux.md
Created August 2, 2019 16:32 — forked from klingtnet/enable-hibernate-arch-linux.md
Enable hiberate in Arch Linux usind kernel 4+, grub2 and a swapfile

This guide is based on the hibernate article from the Arch wiki.

  • edit /etc/default/grub and add resume as well as resume_offset kernel parameters
    • resume=UUID=abcd-efgh contains the UUID of the partition on which the swapfile resides. In most cases the swapfile resides in root, to identify the root parition's UUID run blkid or lsblk -O.
    • resume_offset=1234 is the offset of the swapfile from the partition start. The offset is the first entry in the physical_offset column of the output of filefrag -v /swapfile.
    • update grub: grub-mkconfig -o /boot/grub/grub.cfg
    • example: GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=75972c96-f909-4419-aba4-80c1b74bd605 resume_offset=1492992"
  • add the resume module hook to /etc/mkinitcpio.conf:
    • HOOKS="base udev resume autodetect ...
  • rebuild the initramfs mkinitcpio -p linux
@Ammly
Ammly / ansible_local_playbooks.md
Created May 10, 2019 12:10 — forked from alces/ansible_local_playbooks.md
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@Ammly
Ammly / gist:ff4f5ad2ce7080ef9a7ceeb9d499936e
Created February 13, 2019 16:37 — forked from kyledrake/gist:d7457a46a03d7408da31
Creating a self-signed SSL certificate, and then verifying it on another Linux machine
# Procedure is for Ubuntu 14.04 LTS.
# Using these guides:
# http://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/
# https://turboflash.wordpress.com/2009/06/23/curl-adding-installing-trusting-new-self-signed-certificate/
# https://jamielinux.com/articles/2013/08/act-as-your-own-certificate-authority/
# Generate the root (GIVE IT A PASSWORD IF YOU'RE NOT AUTOMATING SIGNING!):
openssl genrsa -aes256 -out ca.key 2048
openssl req -new -x509 -days 7300 -key ca.key -sha256 -extensions v3_ca -out ca.crt
@Ammly
Ammly / gist:e8123cfb7d5bbed13917
Created November 5, 2015 14:42 — forked from noeldiaz/gist:0f9a2583a41579878764
Homestead 32-bit Version
## Making a 32 bit version of Homestead
# Clone the settler repository to a directory
git clone https://github.com/laravel/settler.git Ubuntu32
# In that directory edit the file called "Vagrantfile" to use a ubuntu 32 box instead of the 64 bit one
change this line:
config.vm.box = "ubuntu/trusty64"
#!/bin/bash
## The post install script for Ubuntu 14.04 LTS
## @author Carlo Micieli
## @version 5.0.5
## Constants
NONE='\e[39m'
RED='\e[31m'
GREEN='\e[32m'
CYAN='\e[36m'