Skip to content

Instantly share code, notes, and snippets.

View asapdotid's full-sized avatar

Asapdotid asapdotid

View GitHub Profile
@asapdotid
asapdotid / install-comodo-ssl-cert-for-nginx.rst
Created October 15, 2018 05:57 — 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

@asapdotid
asapdotid / ansible-role-test.sh
Created September 19, 2019 08:49 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@asapdotid
asapdotid / clean.sh
Created March 25, 2020 14:42 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@asapdotid
asapdotid / config.rasi
Last active September 6, 2021 10:34
Rofi configuration theme (Rofi version 1.7.0)
configuration {
/* modi: "window,run,ssh";*/
/* font: "mono 12";*/
/* location: 0;*/
/* yoffset: 0;*/
/* xoffset: 0;*/
/* fixed-num-lines: true;*/
/* show-icons: false;*/
/* terminal: "rofi-sensible-terminal";*/
/* ssh-client: "ssh";*/
@asapdotid
asapdotid / README.md
Last active September 16, 2021 06:48
Setup Battery Monitor for Linux (Manjaro) with Dunst

Instruction Setup

  1. Setup battery-monitor.sh ($HOME/.config/systemd/user/battery-monitor.sh)
  2. Setup Service battery-monitor.service (/usr/lib/systemd/system/battery-monitor.service)
  3. Enable service sudo systemctl enable battery-monitor.service
  4. Start service sudo systemctl start battery-monitor.service

Thank you

@asapdotid
asapdotid / config
Created September 23, 2021 04:24
i3-config
# i3 config file (v4)
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# $HOME/.i3/config
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
set $mod Mod4
# set default desktop layout (default is tiling)
# workspace_layout tabbed <stacking|tabbed>
@asapdotid
asapdotid / README.md
Created September 30, 2021 12:46 — forked from goll/README.md
Docker nftables configuration for Debian 10
@asapdotid
asapdotid / linux-commands-daily
Last active January 24, 2022 04:54
Linux commands daily
# SSH Copy ID
1. with redirection (ssh at beginning)
ssh <user>@<host> 'cat >> ~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub
2. with pipe (ssh not at beginning)
cat ~/.ssh/id_rsa.pub | ssh <user>@<host> 'cat >> ~/.ssh/authorized_keys'
@asapdotid
asapdotid / permission_ssh_dir_and_files.md
Last active December 2, 2022 02:44
Permission for SSH folder and files

Permissions of files in ssh folder

So I settled to fix the files using my personal device. First I had to look up the the files permissions.

Fixing the file permissions

The following commands should set up everything as before.

Linux Command:

@asapdotid
asapdotid / ssh-tunnel-demo.service
Last active November 8, 2022 11:58
SSH tunneling use autossh
[Unit]
Description=AutoSSH tunnel service to Tokocuan SSH Tunnel App FE Server on local port 2212
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -N -i ~/.ssh/id_rsa ec2-user@ec2-54-169-20-16.ap-southeast-1.compute.amazonaws.com -L 2212:ip-10-0-1-130.ap-southeast-1.compute.internal:22
Restart=on-failure
RestartSec=10
TimeoutSec=10