Skip to content

Instantly share code, notes, and snippets.

View tienthanh2509's full-sized avatar

Phạm Tiến Thành tienthanh2509

View GitHub Profile
@tienthanh2509
tienthanh2509 / no-nag-script.sh
Created December 24, 2023 06:40
Proxmox remove subscription message
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" >/etc/apt/apt.conf.d/no-nag-script
apt reinstall proxmox-widget-toolkit
@tienthanh2509
tienthanh2509 / 01electron.sh
Created August 24, 2023 04:28
Skype / Electron app set custom proxy
#!/bin/bash
# open skype and enable remote inspect
skypeforlinux --inspect http://127.0.0.1:9229
@tienthanh2509
tienthanh2509 / run.sh
Created August 12, 2023 16:22
Termux SSHD for root user
export PATH=/data/data/com.termux/files/usr/bin:$PATH
sshd \
-D -dd \
-p 2222 -e
@tienthanh2509
tienthanh2509 / README.md
Last active July 13, 2022 07:25
Pfsense headless (without VGA and Serial console)

Note

Disable serial hint if needed

Comment out uart hints in file /boot/device.hints

#hint.uart.0.at="isa"
#hint.uart.0.port="0x3F8"
#hint.uart.0.flags="0x10"
@tienthanh2509
tienthanh2509 / README.md
Created April 8, 2022 07:16
Kubectl config switcher

You are tried many kubeconfig files kc command will help it easy to switch multiple kubeconfig file for you

How does it work? The script will scan your config file in ~/.kube/*.yaml and provide a bash shell autocompletion

Provide kc command switch kube config in ~/.kube/*.yaml
Usage: kc <file> | kc <press tab tab>
/**
* This GraphiQL example illustrates how to use some of GraphiQL's props
* in order to enable reading and updating the URL parameters, making
* link sharing of queries a little bit easier.
*
* This is only one example of this kind of feature, GraphiQL exposes
* various React params to enable interesting integrations.
*/
@tienthanh2509
tienthanh2509 / guest_network.sh
Created January 23, 2022 12:56
Isolated guest network setup for Padavan firmware
# DHCP Setting
# LAN > DHCP Server > Custom Configuration File "dnsmasq.conf"
interface=br-guest
listen-address=192.168.3.1
dhcp-range=set:guest,192.168.3.100,192.168.3.200,255.255.255.0,1h
# Router address
dhcp-option=tag:guest,3,192.168.3.1
# DNS V4
dhcp-option=tag:guest,6,8.8.8.8,8.8.4.4
# Domain
@tienthanh2509
tienthanh2509 / auto_logon.sh
Created July 20, 2021 02:55
Ubuntu console auto login
mkdir -p /etc/systemd/system/getty@tty1.service.d
# replace username to user need to auto login
# don't support decrypt
cat << EOF > /etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin username %I $TERM
Type=idle
EOF
@tienthanh2509
tienthanh2509 / Caddyfile
Created July 15, 2021 11:07
Caddy example reverve proxy
# Hide original hostname, skip ssl check destination host, remove forwarded ip/protocol, http only
http://example.com {
reverse_proxy {
to https://1.2.3.4
header_up -X-Forwarded-For
header_up -X-Forwarded-Proto
header_up -Host
header_up Host httpbin.net
transport http {
@tienthanh2509
tienthanh2509 / fortigate-ipv6.md
Last active May 7, 2023 02:22
Enabling IPv6 with DHCPv6-PD and PPPoE on a Fortigate

Log into your Fortigate with SSH and enter the vdom context you are using then edit the WAN interface:

Assumtion

  • wan1 is for pppoe port
  • internal internal switch
  • vlan30 guest vlan
config system interface