Skip to content

Instantly share code, notes, and snippets.

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

Abdurrahman AG hiage

🏠
Working from home
  • Indonesia
  • 09:47 (UTC +07:00)
  • X @HiAgee
View GitHub Profile
@hiage
hiage / ubuntu-network-policy.md
Created June 22, 2022 13:10
ubuntu-network-policy.md

Ubuntu Prompt System Policy Prevents Modification of Network Settings for All Users

Edit /etc/polkit-1/localauthority/50-local.d/10-network-manager.pkla (the file might not exist)

sudo nano /etc/polkit-1/localauthority/50-local.d/10-network-manager.pkla
[Let all users modify system settings for network]
Identity=unix-user:*
Action=org.freedesktop.NetworkManager.settings.modify.system
ResultAny=no
ResultInactive=no
@hiage
hiage / docker-network.txt
Created June 7, 2022 13:06
docker network force remove
#Creating project_service_name_1 ... error
#
#ERROR: for project_service_name_1 Cannot start service service_name: endpoint with name project_service_name_1 already exists in network host
#
#ERROR: for service_name Cannot start service service_name: endpoint with name project_service_name_1 already exists in network host
#ERROR: Encountered errors while bringing up the project.
docker network ls
docker network inspect host
docker network disconnect -f host project_service_name_1
@hiage
hiage / helm.txt
Created April 28, 2022 07:18
helm pull from repo
how to pull chart locally
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo update
helm pull stable/chartmuseum --untar # optionally untar
@hiage
hiage / warning LCC_ALL en_US.UTF-8.md
Last active April 7, 2022 03:06
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) centos 8
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[root@dev ~]# cat /etc/redhat-release 
CentOS Linux release 8.2.2004 (Core)
@hiage
hiage / ssh.txt
Created April 6, 2022 05:07
Ulimit settings not being applied with SSH logins
Ulimit settings not being applied with SSH logins
April 14, 2011, 2:05 pm
On a RHEL5 server ulimit setting was not applied when I logged in using SSH. No matter what I did the setting remained the same. Doing a “su – ” to a user, however, worked like a treat. Strange! I did a bit of googling and found the following answer to my problem:
1. In /etc/pam.d/sshd add the line
session required pam_limits.so
2. In /etc/pam.d/login add the line
session required pam_limits.so

Three system configuration parameters must be set to support a large number of open files and TCP connections with large bursts of messages. Changes can be made using the /etc/rc.d/rc.local or /etc/sysctl.conf script to preserve changes after reboot.

1. /proc/sys/fs/file-max: The maximum number of concurrently open files.

fs.file-max = 1000000

2. /proc/sys/net/ipv4/tcp_max_syn_backlog: Maximum number of remembered connection requests, which are still did not receive an acknowledgment from connecting client. The default value is 1024 for systems with more than 128Mb of memory, and 128 for low memory machines.

net.ipv4.tcp_max_syn_backlog = 3240000

3. /proc/sys/net/core/somaxconn: Limit of socket listen() backlog, known in userspace as SOMAXCONN. Defaults to 128.

net.core.somaxconn = 3240000

@hiage
hiage / elementary os workspaces on all monitor
Last active November 25, 2021 01:13
elementary os workspaces on all monitor
org -> gnome -> mutter and uncheck the box " workspaces-only-on-primary"
or if you do not have installed dconf-editor you can use following terminal commands:
gsettings get org.gnome.mutter workspaces-only-on-primary to check the current setting. Probably it is "true".
gsettings set org.gnome.mutter workspaces-only-on-primary false to make the settings. Now workspace should contain all monitors.
const timer = ms => new Promise(res => setTimeout(res, ms));
setInterval(async () =>
{
// Get all tweets
const allTweets = document.querySelectorAll('.css-1dbjc4n.r-18u37iz.r-1wbh5a2.r-13hce6t');
// Filter tweets
const filteredTweets = Array.prototype.slice.call(allTweets).filter(x => x.innerText === '@username');
@hiage
hiage / ssl cert decode
Last active February 16, 2022 04:18
ssl cert decode
Use this Certificate Decoder to decode your PEM encoded SSL certificate and verify that it contains the correct information.
#fulldetail
openssl x509 -text -noout -in dxxxx_net_id.pem
#check end date only
openssl x509 -enddate -noout -in dxxxx_net_id.pem
notAfter=Feb 24 23:59:59 2023 GMT
@hiage
hiage / nginx_modsecurity.log
Created May 13, 2020 03:00 — forked from vikas027/nginx_modsecurity.log
Nginx compiled with ModSecurity (with JSON Support)
## OS Ubuntu 17.10
## Pre-Requisites
# apt-get install -y git build-essential libpcre3 libpcre3-dev libssl-dev libtool autoconf apache2-dev libxml2-dev libcurl4-openssl-dev automake pkgconf dialog apt-utils
# apt-get install -y g++ flex bison curl doxygen libyajl-dev libgeoip-dev libtool dh-autoreconf libcurl4-gnutls-dev libxml2 libpcre++-dev libxml2-dev libyajl2 yajl-tools
# apt-get install -y libgd2-xpm-dev libgeoip-dev libpam-dev libpcre3 libpcre3-dev google-perftools libgoogle-perftools-dev libatomic-ops-dev libperl-dev
# export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig
## ModSecurity
# cd /usr/src