Skip to content

Instantly share code, notes, and snippets.

Working from home

Faizar Septiawan icarrr

Working from home
View GitHub Profile

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.


git config --global core.excludesfile ~/.gitignore


git config --global core.excludesfile %USERPROFILE%\.gitignore
icarrr / restart_network.ps1
Created Dec 9, 2019
Restart network iFace ethernet and VBox
View restart_network.ps1
# Restart iFace Ethernet
Restart-NetAdapter -Name "Ethernet"
# Restart iFace VBox
Restart-NetAdapter -Name "VirtualBox Host-Only Network"
icarrr / get_list_iface.ps1
Created Dec 9, 2019
Get list interface using PowerShell
View get_list_iface.ps1
netsh interface show interface
icarrr /
Created Dec 9, 2019
Add and remove port RabbitMQ on CentOS 7 or RHEL 7
sudo firewall-cmd --zone=public --permanent --add-port=4369/tcp --add-port=25672/tcp --add-port=5671-5672/tcp --add-port=15672/tcp --add-port=61613-61614/tcp --add-port=1883/tcp --add-port=8883/tcp
sudo firewall-cmd --reload
icarrr /
Created Dec 8, 2019
htmlmin to minify your html
import htmlmin
html = """
<!DOCTYPE html>
<html lang="en">
<title>Bootstrap Case</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
View WS2012R2Optimisations.ps1
Optimises Windows Server 2012 R2 Operating Systems running in a Citrix SBC environment.
This script disables services, disables scheduled tasks and modifies the registry to optimise system performance on Windows Server 2012 R2 running in a Citrix SBC environment.
Script Name : JGSpiers-WS2012R2Optimisations.ps1
icarrr /
Created Dec 4, 2019
Auto reset cert linux
globalTime="$(date '+%Y%m%d %H%M%S' -d "$(curl -s --head | grep ^Date: | sed 's/Date: //g')" | awk '{print $2}')"
if [ $globalTime == "060001" ]; then
icarrr /
Created Dec 3, 2019
Backup and Extract file compress lzma
  1. To backup files to type lzma, run the script.
  2. To extract files, use the following command:
xz -d file.tar.lzma
ls -l # check list file
tar -xvf file.tar
icarrr / main.sql
Created Dec 2, 2019
Get version of Microsoft SQL Server and Microsoft SQL Server Management Studio
View main.sql
SELECT SERVERPROPERTY('ProductVersion') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel,
SERVERPROPERTY('Edition') AS Edition;
EXEC sys.xp_msver;
icarrr /
Last active Dec 13, 2019
Reset the list of trusted CA certificates in RHEL 7
# Get time
localTime=$(date '+%Y%m%d_%H%M%S' -d "$(curl -s --head | grep ^Date: | sed 's/Date: //g')")
# Create cert bak dir
mkdir -p $HOME/cert.bak
# Reset cert
sudo rpm -Vv ca-certificates | awk '$1!="........." && $2!="d" {system("mv -v " $NF " $HOME/cert.bak")}'
sudo yum check-update ca-certificates; (($?==100)) && sudo yum update -y ca-certificates || yum reinstall -y ca-certificates