Skip to content

Instantly share code, notes, and snippets.

View loskiq's full-sized avatar
:octocat:
¯\_(ツ)_/¯

Amir loskiq

:octocat:
¯\_(ツ)_/¯
View GitHub Profile
server {
listen 80;
server_name domain.com;
location / {
return 301 https://$server_name$request_uri;
}
}
@loskiq
loskiq / config.yaml
Last active August 16, 2025 14:48
Xray on OpenWrt
inbounds:
- listen: 192.168.1.1
tag: all-in
port: 1083
protocol: dokodemo-door
settings:
network: tcp,udp
followRedirect: true
streamSettings:
sockopt:
@loskiq
loskiq / .bashrc
Created November 26, 2024 06:49
My bash aliases
alias e='exit'
alias s='ssh'
alias ls='ls -al --group'
alias rm='rm -rf'
alias nano='nano -w -l -$'
alias mc='EDITOR=nano mc'
alias shred='shred -u -z -n 10'
alias nload='nload -t 1000'
alias iftop='iftop -n -N -P'
alias mtr='mtr -n'
@loskiq
loskiq / nftables.conf
Last active August 28, 2024 10:38
allow ssh from specified hosts or networks
table ip filter {
set allow-ssh {
type ipv4_addr
flags interval
elements = { 7.9.8.0/24, 1.2.3.4 }
}
chain input {
type filter hook input priority filter; policy accept;
ip saddr != @allow-ssh tcp dport 22 ct state new reject with tcp reset
@loskiq
loskiq / 3x-ui.md
Last active August 27, 2025 10:18
xray

Generate self-signed certificate

openssl req -x509 -keyout /etc/ssl/certs/3x-ui.key -out /etc/ssl/certs/3x-ui.pem -newkey rsa:4096 -sha256 -days 3650 -nodes -new

Generate self-signed certificate with Subject Alternative Name

openssl req -x509 -keyout /etc/ssl/certs/3x-ui.key -out /etc/ssl/certs/3x-ui.pem -newkey rsa:4096 -sha256 -days 3650 -nodes -new -addext "subjectAltName=DNS:*.domain.com"
@loskiq
loskiq / drbd-up.service
Created November 22, 2022 13:50
Up all DRBD resources after boot
[Unit]
Description=Up all DRBD resources
After=network-online.target
Wants=network-online.target
Before=libvirtd.service
[Service]
Type=simple
ExecStart=/usr/sbin/drbdadm up all

Bittorrent uTorrent disable ads

Turn off ALL Ads/Featured Content/Bundle Crap in Utorrent/Bittorrent:

Options > Preferences > Advanced... Turn ALL settings to false:

  • bt.enable_pulse
  • distributed_share.enable
  • gui.show_notorrents_node
  • offers.left_rail_offer_enabled
@loskiq
loskiq / PVE-HP-ssacli-smart-storage-admin.md
Created January 20, 2022 21:54 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation