Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
Working from home

Faizar Septiawan icarrr

🏡
Working from home
View GitHub Profile
@icarrr
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
icarrr / get_list_iface.ps1
Created Dec 9, 2019
Get list interface using PowerShell
View get_list_iface.ps1
netsh interface show interface
CMD /c PAUSE
@icarrr
icarrr / add_port.sh
Created Dec 9, 2019
Add and remove port RabbitMQ on CentOS 7 or RHEL 7
View add_port.sh
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
icarrr / main.py
Created Dec 8, 2019
htmlmin to minify your html
View main.py
import htmlmin
html = """
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Case</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
View WS2012R2Optimisations.ps1
<#
.SYNOPSIS
Optimises Windows Server 2012 R2 Operating Systems running in a Citrix SBC environment.
.DESCRIPTION
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 CONSTRUCT
Script Name : JGSpiers-WS2012R2Optimisations.ps1
@icarrr
icarrr / main.sh
Created Dec 4, 2019
Auto reset cert linux
View main.sh
#!/bin/bash
globalTime="$(date '+%Y%m%d %H%M%S' -d "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')" | awk '{print $2}')"
if [ $globalTime == "060001" ]; then
$HOME/reset_cert.sh
fi
@icarrr
icarrr / README.md
Created Dec 3, 2019
Backup and Extract file compress lzma
View README.md
  1. To backup files to type lzma, run the main.sh script.
  2. To extract files, use the following command:
xz -d file.tar.lzma
ls -l # check list file
tar -xvf file.tar
@icarrr
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
icarrr / main.sh
Last active Dec 13, 2019
Reset the list of trusted CA certificates in RHEL 7
View main.sh
#!/bin/bash
# Get time
localTime=$(date '+%Y%m%d_%H%M%S' -d "$(curl -s --head http://google.com | 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
@icarrr
icarrr / rabbitmq.txt
Created Nov 28, 2019 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
View rabbitmq.txt
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"