Skip to content

Instantly share code, notes, and snippets.

View mariotpc's full-sized avatar
🎯
Focusing

Mario Enrique Lopez Guzman mariotpc

🎯
Focusing
View GitHub Profile
@mariotpc
mariotpc / proxmox extend disk
Created February 5, 2024 19:58
proxmox extend disk
root@workstation:~# parted
GNU Parted 3.6
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) quit
root@workstation:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 50G 0 disk
??sda1 8:1 0 1M 0 part
??sda2 8:2 0 1G 0 part /boot
@mariotpc
mariotpc / Mouse Logitec not connect on Linux
Created February 2, 2024 18:16
Mouse Logitec not connect on Linux
So far what has worked for me is simply find the file /lib/udev/rules.d/97-hid2hci.rules.
https://unix.stackexchange.com/questions/105585/udev-rule-for-bluetooth-device-logitech
Find this entry, and comment it out:
# Logitech devices
KERNEL=="hiddev*", ATTRS{idVendor}=="046d",
@mariotpc
mariotpc / lighttpd username , password authentication
Created January 25, 2024 17:23
lighttpd username , password authentication
Taken from:
https://redmine.lighttpd.net/boards/2/topics/7984
Forums » Support »
[Solved] username / password authentication
Added by drkbkr almost 6 years ago
Hi, We're having some trouble with username / password authentication and was wondering if anyone could help. I've stripped pieces of the configuration out (and changed the backend to plain) so it's as simple as possible.
@mariotpc
mariotpc / Hurricane Electric DNS Servers
Created April 13, 2023 23:17
Hurricane Electric DNS Servers
Hurricane Electric
https://dns.he.net/
IPv4 DNS Server:
74.82.42.42
IPv6 DNS Server:
2001:470:20::2
@mariotpc
mariotpc / wg interface script
Created April 6, 2023 16:35
wg interface script
[Interface]
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Address = 172.20.21.4/24, fe00:a::4/64, xxxx:xxx:a::1/64
MTU = 1412
PostUp = echo "$(date +%s) Wireguard Started " >> /var/log/wireguard.log
PostDown = echo "$(date +%s) Wireguard Stop " >> /var/log/wireguard.log
PostUp = export EXITCODE=$(ifconfig wlp0s20f3 | grep inet | grep 192.168.200 | awk '{print $2}')
PostUp = test -z "$EXITCODE" && echo "Not working on the office network" || ip r add 192.168.200.0/24 via 192.168.1.1 dev wlp0s20f3
@mariotpc
mariotpc / Can't resize boot-EFI partition with GParted
Created April 5, 2023 18:16
Can't resize boot-EFI partition with GParted
Creating an EFI System Partition
If you are manually partitioning your disk in the Ubuntu installer, you need to make sure you have an EFI System Partition (ESP) set up. This partition holds EFI-mode boot loaders and related files.
If your disk already contains an ESP (eg if your computer had Windows 8 preinstalled), it can be used for Ubuntu too. Do not format it. It is strongly recommended to have only 1 ESP per disk.
An ESP can be created via a recent version of GParted (the Gparted version included in the 12.04 disk is OK), and must have the following attributes:
Mount point: /boot/efi (remark: no need to set this mount point when using the manual partitioning, the Ubuntu installer will detect it automatically)
Size: minimum 100Mib. 200MiB recommended.
@mariotpc
mariotpc / xauth sudo not working
Created March 31, 2023 22:33
xauth sudo not working
Another solution is to merge the .Xauthority file of the current user with that of the root user.
ssh user@host
change the .Xauthority file permissions so that root also has access to it.
sudo su - root
xauth merge /home/users/user/.Xauthority
Test
gedit somefile.log
@mariotpc
mariotpc / Yubico YubiKey udev rules and pcsc auth
Last active June 17, 2023 00:27
Yubico YubiKey udev rules and pcsc auth
70-u2f.rules
[root@workstation rules.d]# cat 70-u2f.rules
# Copyright (C) 2013-2015 Yubico AB
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
@mariotpc
mariotpc / wg-speedy.sh
Created February 8, 2023 14:38 — forked from juddgaddie/wg-speedy.sh
Setting up wireguard in a specific VRF and adding a route. Works with Cumulus Linux
#!/bin/bash
#to enable debugging
#echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control
ip rule add fwmark 1001 iif lo priority 4999 table mgmt
ip link add dev wg0 type wireguard
ip -4 address add 10.1.50.43/16 dev wg0
wg setconf wg0 <(wg-quick strip /etc/wireguard/wg0.conf)
wg set wg0 fwmark 1001
@mariotpc
mariotpc / firewalld port forward and expose ports
Created January 26, 2023 18:10
firewalld port forward and expose ports
Be sure that FirewallD is running if not... start it !
systemctl start firewalld
To expose ports to external access use
firewall-cmd --zone=public --add-port=22/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
To access outside to internal server, explicit port 2333 use