Smart 🧠 Fullstack
45 subscribers
166 photos
11 videos
12 files
153 links
About channel: everyday developer hints.

for (💲Coders as 💲Student):
echo("Hello 💲Student->name");
endfor;

Author: @BakirovRoman
Download Telegram
Open Terminal Strict Under Cursor via Ctrl + Alt + T

~/.local/bin/terminal-at-cursor.sh
#!/bin/bash
# Open xfce4-terminal at the current mouse cursor position

# Get current mouse position
eval "$(xdotool getmouselocation --shell)"

# Launch terminal at cursor position using geometry hints
# --disable-server prevents D-Bus reuse so it's a fresh process
# --geometry=COLSxROWS+X+Y sets position in pixels
xfce4-terminal --disable-server --geometry="80x24+${X}+${Y}"


~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
...
<property name="&lt;Primary&gt;&lt;Alt&gt;t" type="string" value="/home/romaxa/.local/bin/terminal-at-cursor.sh"/>
...


#xfce #terminal #ux
Close any window with Ctrl+Alt+Click (XFCE / X11)

Tired of aiming at the tiny X button? Here's how to close any window by just Ctrl+Alt+Clicking
anywhere on it.

Prerequisites: XFCE on X11, xdotool installed.

1. Install xbindkeys

sudo apt install xbindkeys


2. Create the script

~/.local/bin/close-window-under-cursor.sh
#!/bin/bash
eval $(xdotool getmouselocation --shell)
[ "$WINDOW" -gt 0 ] 2>/dev/null && xdotool windowclose "$WINDOW"


Make it executable:
chmod +x ~/.local/bin/close-window-under-cursor.sh


3. Create xbindkeys config
~/.xbindkeysrc
"~/.local/bin/close-window-under-cursor.sh"
Control+Alt + b:1


4. Autostart on login

~/.config/autostart/xbindkeys.desktop
[Desktop Entry]
Type=Application
Name=xbindkeys
Exec=xbindkeys
StartupNotify=false


5. Start it now (without relogging):
xbindkeys


Done. Hold Ctrl+Alt and click on any window to close it.

To revert:
killall xbindkeys
rm ~/.xbindkeysrc
rm ~/.local/bin/close-window-under-cursor.sh
rm ~/.config/autostart/xbindkeys.desktop
sudo apt remove xbindkeys # optional


#xbindkeys #close #window
👍1
👍1👌1
Tag Pusher

Simple (per-project): (attached)

Common (system global):
WIP


#tag #git #automatization
👍1
Show Git Rule 4 Ignore

git check-ignore -v vendor


Show Untracked
# All untracked files (including ignored ones)                                                                                                                                                        
git ls-files --others

# Untracked files only (excluded by ignore rules)                                                                                                                                                     
git ls-files --others --exclude-standard

# Ignored files only (matched by ignore rules)
git ls-files --others --ignored --exclude-standard


#git #ignore #debug #exclude #gitignore #untracked
🔍 3 Ways to Monitor File Changes in Linux at the OS Level

Ever needed to know the moment a file changes on your system? Linux gives you three built-in mechanisms for that.

1️⃣ inotify (the go-to choice)

The most popular way. Install inotify-tools and you're one command away:

inotifywait -r -m -e modify,create,delete /path/to/dir


Event-driven, lightweight, perfect for most use cases. Just watch out for the per-user watch limit (/proc/sys/fs/inotify/max_user_watches).

2️⃣ fanotify (the big gun)

Unlike inotify, fanotify works at the mount point level — it can monitor an entire filesystem without setting a watch on every single file. This is what antivirus engines use under the hood.

The easiest way to try it is fatrace:


sudo apt install fatrace
sudo fatrace
sudo fatrace -f W -c # only writes, with command names


The trade-off: requires root and has a more complex C API for programmatic use.

3️⃣ auditd (the forensic tool)

When you need to know not just what changed, but who changed it and which process did it:

sudo auditctl -w /etc/passwd -p wa -k passwd_changes
sudo ausearch -k passwd_changes


Full audit trail with PIDs, UIDs, and timestamps. Heavier than the other two, but invaluable for security and compliance.

TL;DR:
— Need to react to changes → inotify
— Need to watch everything at once → fanotify
— Need to know who did it → auditd

#linux #sysadmin #monitoring #devops
🤯1😭1
Opus 4.7
Bash Script 4 Put All JetBrains Projects to Desktop Links / Main Menu

https://github.com/makhnanov/create-jb-launchers

bash <(curl -fsSL https://cdn.jsdelivr.net/gh/makhnanov/create-jb-launchers@main/create-jb-launchers.sh)


ToDo: --non-interactive & cron

#webstorm #jetbrains #bash #projects