This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
for host in /sys/class/scsi_host/*; do echo "- - -" | sudo tee $host/scan; ls /dev/sd* ; done | |
or | |
echo "- - -" | tee /sys/class/scsi_host/host*/scan | |
lsblk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Temporary file to store IPs dropped by iptables in DENYIN chain | |
TEMP_DROPPED_IPS="/tmp/dropped_ips.txt" | |
# Function to extract IP blocks/ranges being dropped in the DENYIN chain | |
get_dropped_ips() { | |
# Extract IP blocks/ranges that are actively being dropped in the DENYIN chain | |
iptables -vL DENYIN -n | grep 'DROP' | awk '{if ($1 > 0) print $8}' | sort | uniq > "$TEMP_DROPPED_IPS" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\*\shell\Notepad++] | |
@="Edit With Notepad++" | |
"Icon"="C:\\Program Files\\Notepad++\\notepad++.exe,0" | |
[HKEY_CLASSES_ROOT\*\shell\Notepad++\command] | |
@="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -oP '(?<=client: )[\d.]+(?=,)' /var/log/nginx/error.log | sort | uniq -c | sort -nr | head -n 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/sbin/iptables-save | awk '/^COMMIT$/ { delete x; }; !x[$0]++' > /tmp/iptables.conf | |
/sbin/iptables -F | |
/sbin/iptables-restore < /tmp/iptables.conf | |
/sbin/iptables-save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Directory "D:/wamp64/bin/php/php8.2.18"> | |
Require all granted | |
</Directory> | |
ScriptAlias /php-cgi-8.2 "D:/wamp64/bin/php/php8.2.18/php-cgi.exe" | |
Action application/x-httpd-php8 /php-cgi-8.2 | |
<FilesMatch "\.php8$"> | |
SetHandler application/x-httpd-php8 | |
AllowOverride All |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM Find the first Go file in the folder | |
for %%f in (*.go) do ( | |
set GOFILE=%%f | |
goto :found | |
) | |
:found | |
if not defined GOFILE ( | |
echo No Go file found in the current directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\Directory\Background\shell\NewGoFile] | |
"Icon"="C:\\Program Files\\Go\\bin\\go.exe" | |
"MUIVerb"="New Go File" | |
"Position"="Top" | |
[HKEY_CLASSES_ROOT\Directory\Background\shell\NewGoFile\command] | |
@="cmd /c \"echo. > \"%V\\newfile.go\" && notepad \"%V\\newfile.go\"\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CentOS-Base.repo | |
# | |
# The mirror system uses the connecting IP address of the client and the | |
# update status of each mirror to pick mirrors that are updated to and | |
# geographically close to the client. You should use this for CentOS updates | |
# unless you are manually picking other mirrors. | |
# | |
# If the mirrorlist= does not work for you, as a fall back you can try the | |
# remarked out baseurl= line instead. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go build -ldflags "-s -w" | |
PS C:\> sc.exe create MyService <path to your service_app.exe> | |
PS C:\> sc.exe start MyService | |
PS C:\> sc.exe delete MyService | |
// file: main.go | |
package main | |
import ( |
NewerOlder