Skip to content

Instantly share code, notes, and snippets.

@danurwijayanto
danurwijayanto / iptables.sh
Created August 13, 2023 07:40 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers

My notes about My First SSO Configuration

War Location

build/libs/cas.war

Disable webflow crypto

Open etc/cas/config/cas.properties

@danurwijayanto
danurwijayanto / my-code-notes.md
Last active March 20, 2023 12:05
Catatan harian codeku

My notes about my codes

Nest jS

Error and Solution

Problem : node_modules/@types/express/node_modules/@types/express-serve-static-core/index"' has no exported member 'Locals'.

Solution : Upgrade @types/express from ^4.17.1 to 4.17.8

yarn add @types/[email protected]
@danurwijayanto
danurwijayanto / my-notes.md
Last active April 20, 2025 23:28
Catatan Harianku

My notes about my worlds

Git Cheatseet

Change from username password authentication to PAT Gitlab -> Link

nano .git/config

https://gitlab-ci-token:<private token>@github.com/myuser/myrepo.git

Centos Cheatseet

@danurwijayanto
danurwijayanto / ddnsserver.py
Created March 22, 2022 09:55 — forked from pklaus/ddnsserver.py
Simple DNS server (UDP and TCP) in Python using dnslib.py
#!/usr/bin/env python
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import argparse
import datetime
import sys
import time
import threading
@danurwijayanto
danurwijayanto / psql_useful_stat_queries.sql
Created February 10, 2022 12:27 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@danurwijayanto
danurwijayanto / postgres_queries_and_commands.sql
Created January 28, 2022 10:24 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@danurwijayanto
danurwijayanto / nginx-tuning.md
Created July 14, 2019 01:21 — 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.

@danurwijayanto
danurwijayanto / amazon-ec2-ftp.md
Created December 29, 2018 03:57 — forked from gunjanpatel/amazon-ec2-ftp.md
amazon ec2 LAMP and FTP installation and setup
@danurwijayanto
danurwijayanto / proxy.apache.conf
Created October 24, 2018 18:00 — forked from chrisjhoughton/proxy.apache.conf
Sample Nginx reverse proxy to Apache set up for Wordpress.
<VirtualHost *:{PORT}>
ServerName www.yourdomain.com
ServerAdmin [email protected]
DocumentRoot /var/www/yourdir/
<Directory /var/www/yourdir>
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny