keycode 52 = y Y y Y bar U203A guillemotrightBut under wayland i had to change to evremap (https://github.com/wez/evremap)
keycode 59 = comma semicolon comma semicolon less multiply periodcentered
keycode 60 = period colon period colon greater division U2026
[ 4920.421719] usb 3-4.2: new low-speed USB device number 17 using xhci_hcdSearch for name attribute
[ 4920.539376] usb 3-4.2: New USB device found, idVendor=0e8f, idProduct=0022, bcdDevice= 2.10
[ 4920.539386] usb 3-4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4920.539390] usb 3-4.2: Product: USB KB V11
[ 4920.539392] usb 3-4.2: Manufacturer: GASIA
[ 4920.614311] input: GASIA USB KB V11 as /devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-4/3-4.2/3-4.2:1.0/0003:0E8F:0022.001A/input/input57
ATTR{name}=="GASIA USB KB V11"and build an udev rule for systemd tagging
ACTION!="remove", SUBSYSTEMS=="input", ATTRS{name}=="GASIA USB KB V11", TAG+="systemd"and reload udev and trigger
dev-input-by\x2did-usb\x2dGASIA_USB_KB_V11\x2devent\x2dkbd.device loaded active plugged USB_KB_V11and check for status with
dev-input-by\x2dpath-pci\x2d0000:03:00.4\x2dusb\x2d0:4.2:1.0\x2devent\x2dkbd.device loaded active plugged USB_KB_V11
dev-input-event12.device loaded active plugged USB_KB_V11
sys-devices-pci0000:00-0000:00:08.1-0000:03:00.4-usb3-3\x2d4-3\x2d4.2-3\x2d4.2:1.0-0003:0E8F:0022.001A-input-input57-event12.device loaded active plugged USB_KB_V11
sys-devices-pci0000:00-0000:00:08.1-0000:03:00.4-usb3-3\x2d4-3\x2d4.2-3\x2d4.2:1.0-0003:0E8F:0022.001A-input-input57.device loaded active plugged USB_KB_V11
● dev-input-by\x2did-usb\x2dGASIA_USB_KB_V11\x2devent\x2dkbd.device - USB_KB_V11and install evremap with correct permission and ownership
Follows: unit currently follows state of sys-devices-pci0000:00-0000:00:08.1-0000:03:00.4-usb3-3\x2d4-3\x2d4.2-3\x2d4.2:1.0-0003:0E8F:0022.001A-input-input57-event12.device
Loaded: loaded
Active: active (plugged) since Mon 2023-09-25 09:32:57 CEST; 1h 27min ago
Until: Mon 2023-09-25 09:32:57 CEST; 1h 27min ago
Device: /sys/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-4/3-4.2/3-4.2:1.0/0003:0E8F:0022.001A/input/input57/event12
-rwxr-xr-x 1 root root 15726808 Sep 20 15:37 /usr/bin/evremapand discover the name with
device_name = "GASIA USB KB V11"/etc/systemd/system/evremap.service
[[remap]]
input = ["KEY_RIGHTALT", "KEY_Z"]
output = ["KEY_RIGHTALT", "KEY_102ND"]
[[remap]]
input = ["KEY_RIGHTALT", "KEY_COMMA"]
output = ["KEY_102ND"]
[[remap]]
input = ["KEY_RIGHTALT", "KEY_DOT"]
output = ["KEY_LEFTSHIFT", "KEY_102ND"]
[Unit]#> systemd enable evremap]]>
Description=Keyboard Remap
BindsTo=dev-input-by\x2did-usb\x2dGASIA_USB_KB_V11\x2devent\x2dkbd.device
[Service]
WorkingDirectory=/
ExecStart=/usr/bin/evremap remap /etc/evremap.toml -d 0
Restart=always
[Install]
WantedBy=dev-input-by\x2did-usb\x2dGASIA_USB_KB_V11\x2devent\x2dkbd.device
#> sudo wireshark -k -i /tmp/shark
#> ssh USER@HOST 'sudo -S /usr/sbin/tcpdump -i eth0 -w - -p -n -s 0' | wireshark -k -i -
~# ip addr | grep -A 5 wlan10: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
[Match]
Name=wlan0
[Network]
Address=192.168.0.1/24
DHCPServer=yes
IPMasquerade=true
IPForward=true
[DHCPServer]
PoolOffset=100
PoolSize=20
EmitDNS=yes
DNS=your_dns_server
[Unit]
Requires=sys-subsystem-net-devices-wlan0.device systemd-networkd.service
After=sys-subsystem-net-devices-wlan0.device
BindsTo=sys-subsystem-net-devices-wlan0.device
[Install]
WantedBy=sys-subsystem-net-devices-wlan0.device
~# systemctl enable hostapdAutostop of hostapd
[Unit]]]>
After=hostapd.service
BindsTo=hostapd.service
blacklist em28xx
blacklist em28xx_v4l
blacklist em28xx_dvb
blacklist em28xx_rc
[Unit]
Description=em28xx card sequence detection
After=local-fs.target
Before=motion.service vdr.service
[Service]
ExecStart=/usr/local/bin/em28xx_detect.sh
Type=oneshot
[Install]
WantedBy=multi-user.target
#!/bin/sh]]>
modprobe em28xx
sleep 1
modprobe -r em28xx_rc
modprobe -r em28xx_v4l
modprobe -r em28xx_dvb
modprobe -r em28xx
IFS="
"
for line in $(dmesg|grep em28xx|grep 'New device'|tail -4)
do
[ -z "$cards" ] || cards="${cards},"
case "$line" in
*eb1a:2821*) cards="${cards}9" ;;
*2013:024c*) cards="${cards}80" ;;
*2013:0258*) cards="${cards}92" ;;
esac
done
modprobe em28xx card=$cards disable_ir=1 disable_usb_speed_check=1
sleep 10
sudo useradd USER -d /home/USER -s /bin/bash
sudo mkdir /home/USER
sudo chown USER:USER /home/USER
sudo su USER
cd
touch .hushlogin (is used to not display motd's)
mkdir .ssh
chmod 0700 .ssh
cd .ssh
ssh-keygen -t rsa -b 4096
mv id_rsa.pub authorized_keys
exit
sudo passwd -d USER
sudo chown root:root /home/USER (for sshd chroot)
sudo cp own_loginshell /home/USER/
/*]]>
simple program to print to stdout and read from stdin without libc for x86-64
taken from https://hero.handmade.network/forums/code-discussion/t/861-compiling_without_libc_on_linux
gcc -s -Os -nostdlib -ffreestanding -static own_loginshell.c -o own_loginshell
*/
#include <stddef.h>
#include <syscall.h>
static void exit(int code)
{
__asm__ __volatile__(
"syscall"
:
: "a"(__NR_exit)
: "cc", "rcx", "r11", "memory");
__builtin_unreachable(); // syscall above never returns
}
// returns negative value for error (for example, if error is EINVAL, then -EINVAL is returned)
static int write(int fd, const void *buf, size_t size)
{
long result;
__asm__ __volatile__(
"syscall"
: "=a"(result)
: "0"(__NR_write), "D"(fd), "S"(buf), "d"(size)
: "cc", "rcx", "r11", "memory");
return result;
}
static int read(int fd, char *buf, size_t size)
{
long result;
__asm__ __volatile__(
"syscall"
: "=a"(result)
: "0"(__NR_read), "D"(fd), "S"(buf), "d"(size)
: "cc", "rcx", "r11", "memory");
return result;
}
void _start()
{
char text[] = "press enter to close connection";
// for this example let's ignore result of write
// but you should really handle it
// 1 is stdout file handle
write(1, text, sizeof(text) - 1);
read(0, text, 1);
exit(0);
}
sudo apt-get install oathtool libpam-oath
export HEX_SECRET=$(head -10 /dev/urandom | md5sum | cut -b 1-30)
oathtool --verbose --totp $HEX_SECRET
sudo bash -c "echo HOTP/T30 $USER - $HEX_SECRET >> /etc/security/users.oath"
sudo chmod 0600 /etc/security/users.oath
unset HEX_SECRET
auth sufficient pam_oath.so usersfile=/etc/security/users.oath window=10 digits=6
sudo sed -Ei -e 's/(ChallengeResponseAuthentication) no/\1 yes/' /etc/ssh/sshd_config
sudo service ssh restart
ssh localhost
auth [success=1 default=ignore] pam_succeed_if.so user in user1:user2]]>
#> apt-get install jmtpfs/etc/udev/rules.d/99-jmtpfs.rules
#> mkdir -p /media/mtp
ACTION=="add", ENV{ID_MTP_DEVICE}=="1", RUN="/usr/bin/jmtpfs -o allow_other /media/mtp"
ACTION=="remove", ENV{ID_MTP_DEVICE}=="1", RUN="/bin/fusermount -u /media/mtp""
apt-get install libusb-dev libmtp-dev
git clone https://github.com/phatina/simple-mtpfs.git
cd imple-mtpfs
./autogen.sh
mkdir build && cd build
../configure --prefix=/usr
make
sudo make install
ACTION=="add",ENV{ID_MTP_DEVICE}=="1",RUN="/usr/bin/simple-mtpfs -o allow_other /media/mtp"
ACTION=="remove", ENV{ID_MTP_DEVICE}=="1", RUN="/bin/fusermount -u /media/mtp""
avconv -i input.m4a output.wav
for f in *.m4a; do avconv -i "$f" "${f/%m4a/wav}"; done
faad -o output.wav input.aac
sox -t raw -r 8000 -A -b 8 -c 1 file.alaw file.wav
sox -t raw -r 8000 -U -b 8 -c 1 file.mulaw test.wav
sox file.wav -t raw -r 8000 -c 1 -b 8 -U file.mulaw
sox file.wav -t raw -r 8000 -c 1 -b 8 -A file.alaw
sox test.wav 60secs.wav --show-progress trim 0 01:00]]>