Skip to content

Instantly share code, notes, and snippets.

View bandithijo's full-sized avatar
🌱
Working from Home

Rizqi Nur Assyaufi bandithijo

🌱
Working from Home
View GitHub Profile
@bandithijo
bandithijo / scammer.md
Created April 25, 2026 08:48 — forked from adibhanna/scammer.md
Claude Code Security Analysis (on https://github.com/ritualPlay-Net/RitualPlay/)
@bandithijo
bandithijo / tlp.conf
Created October 8, 2025 22:25
My ThinkPad X260 TLP Configuration - 2025-10-09
# ------------------------------------------------------------------------------
# /etc/tlp.conf - TLP user configuration (version 1.8.0)
# See full explanation: https://linrunner.de/tlp/settings
#
# Copyright (c) 2025 Thomas Koch <linrunner at gmx.net> and others.
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Settings are read in the following order:
#
# 1. Intrinsic defaults
@bandithijo
bandithijo / setup-postgresql-vagrant.md
Created September 30, 2021 16:08 — forked from carymrobbins/setup-postgresql-vagrant.md
Configure PostgreSQL in a Vagrant guest to allow connections from the host.

Configure Postgres

  • Update pg_hba.conf (most likely in /etc/postgresql/9.4/main) with -
    • host all all 0.0.0.0/0 trust
  • Update postgresql.conf to use listen_addresses = '*'
  • Be sure to sudo service postgresql restart

Configure Vagrant

@bandithijo
bandithijo / dwm.c
Created August 5, 2021 05:50
sendmoncenter - Center the floating window client when send to another monitor
diff --git a/dwm.c b/dwm.c
index 5e4d494..c20023e 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1418,6 +1418,8 @@ sendmon(Client *c, Monitor *m)
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
+ c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
+ c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
@bandithijo
bandithijo / dwm.c
Last active August 6, 2021 05:36
togglefloating centered window
void
togglefloating(const Arg *arg)
{
if (!selmon->sel)
return;
if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
return;
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
if (selmon->sel->isfloating)
/* restore last known float dimensions */
@bandithijo
bandithijo / ru-gaps_add_monocle_tile_gaps.diff
Last active August 1, 2021 11:10
Add gaps on monocle() and tile() on ru-gaps patch
Add gaps on monocle() and tile() if n == 1 only
---
dwm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dwm.c b/dwm.c
index 1767b7f..a0e5b1f 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1119,7 +1119,8 @@ monocle(Monitor *m)
@bandithijo
bandithijo / dwm.c
Last active December 9, 2020 14:07
dwm movethrow patch with ru-gaps
void
movethrow(const Arg *arg)
{
Client *c;
int nh, nw, nx, ny;
c = selmon->sel;
if (selmon->lt[selmon->sellt]->arrange && !c->isfloating)
togglefloating(NULL);
nw = c->w;
nh = c->h;
@bandithijo
bandithijo / dwm.c
Last active November 8, 2020 07:15
warp patch modification for mouse cursor not follow focused window but follow focused monitor with mouse cursor position on bottom right.
void
warp(const Client *c)
{
int x, y;
if (c || !c) {
XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww, selmon->wy + selmon->wh);
return;
}
@bandithijo
bandithijo / dwm.c
Last active November 8, 2020 07:22
dwm with nmaster count indicator on tile symbol & limit number of nmaster
/*
Define limit nmaster on config.h
static const int maxnmaster = 4;
*/
void
incnmaster(const Arg *arg)
{
selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 1);
@bandithijo
bandithijo / sxhkdrc
Created October 9, 2020 13:32
sxhkdrc for volume speaker, microphone, monitor & brightness level
# pulseaudio controls speaker volume up & down
{XF86AudioRaiseVolume, XF86AudioLowerVolume}
pamixer {-i 2, -d 2}; \
ou_vol=$(pamixer --get-volume); \
jack_stat=$($HOME/bin/has_headphone); \
[ $jack_stat = "yes" ] && icon=" "; \
[ $jack_stat = "no" ] && icon=" "; \
dunstify "$icon Volume: "$ou_vol -t 1000 -r 1
# pulseaudio controls mic volume up & down