Skip to content

Instantly share code, notes, and snippets.

View AasSuhendar's full-sized avatar
🎯
Focusing

Aas Suhendar AasSuhendar

🎯
Focusing
View GitHub Profile
@AasSuhendar
AasSuhendar / daily-net-tools.md
Last active April 29, 2019 08:10
Daily Net Tools CLI

Net Tools

Curl

is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.

curl -vkl [host url]

CSR Generation: Using OpenSSL (Apache w/mod_ssl, NGINX, OS X)

A CSR is a file containing your certificate application information, including your Public Key. Generate keys and certificate: To generate a pair of private key and public Certificate Signing Request (CSR) for a webserver, "server", use the following command :

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/private.key -out /etc/ssl/certs/cert.crt

This creates a two files. The file myserver.key contains a private key; do not disclose this file to anyone. Carefully protect the private key.

CSR Decode : Using OpenSSL

@AasSuhendar
AasSuhendar / MongoCLI.md
Created September 11, 2019 16:39
MongoCLI Tools Dump and Restore daily used

MongoCLI Tools Dump and Restore

Dump and Restore

Pure Dump

mongodump -u [user] -p [pass] --db [dbname] --out [path-file]

Pure Restore

@AasSuhendar
AasSuhendar / .zshrc
Created November 14, 2019 03:57
ZSHRC
# Customise the Powerlevel9k prompts
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# context
dir
# custom_javascript
vcs
# newline
)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
@AasSuhendar
AasSuhendar / icinga2-setup.md
Last active June 23, 2020 07:53
Icinga2 Setup Guide

Setup Icinga2

Icinga is a monitoring system which checks the availability of your network resources, notifies users of outages, and generates performance data for reporting. Icinga 2 is the monitoring server and requires Icinga Web 2 on top in your Icinga Stack.

This document will guide you to provision and installing Icinga2 with:

  1. Master Node
  2. Agent Node
@AasSuhendar
AasSuhendar / jitsi.md
Last active April 27, 2020 15:46
This is note to setup Jitsi on Ubuntu 18.04

Setup Jitsi for WebRTC Video Conference

Setup Jitsi Meet for WebRTC Video Conference in your own on-premises, cloud, or dedicated servers.

Preparation

OS Preparation

sudo su # escelate privileged to root
apt-get update && apt-get dist-upgrade -y # upgrade OS distribution
@AasSuhendar
AasSuhendar / cheetsheet_oc_command.md
Last active July 8, 2020 09:24
Daily Commands on OpenShift

Daily Commands on OpenShift

Client

Initial Client Setup

oc login [url of console openshift]
Authentication required for https://console.example.id:443 (openshift)
Username: admin
Password:
@AasSuhendar
AasSuhendar / linux-tcp.txt
Created September 19, 2021 05:56 — forked from maxp/linux-tcp.txt
Tuning the Linux Kernel for many tcp connections
Put these in /etc/sysctl.conf then run sysctl -p to apply them.
# General gigabit tuning:
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_syncookies = 1
# this gives the kernel more memory for tcp
@AasSuhendar
AasSuhendar / nginx-tuning.md
Created September 19, 2021 06:23 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@AasSuhendar
AasSuhendar / README-setup-tunnel-as-systemd-service.md
Created September 19, 2021 06:35 — forked from drmalex07/README-setup-tunnel-as-systemd-service.md
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target