usb – Mouse keeps disconnecting and reconnecting while the mouse’s red light stays on

When I connect the cable of the mouse to my laptop, the mouse eventually connects with the windows ‘connected’ sound. But the mouse disconnects randomly (with the windows disconnected sound), and surprisingly the red light of the mouse stays on. meaning the mouse is fully powered but my laptop cannot detect the mouse. I eventually manage to reconnect the mouse by disconnecting and reconnecting the CABLE. But unfortunately, the problem repeats. Sometimes I don’t do anything and the mouse reconnects on its own somehow. This shit happens randomly.
This problem only happens with my one mouse, I have an another wireless one which works fine.

usb on the go – How to simulate mouse OTG input via USB without usb debugging?

The question is simple, the reason: A black screen phone, it is able to manage OTG connection, but as I don’t see the screen is useless, and it’s very hard to controll a mouse without seeing the screen so I searched about using a usb cable to control my phone with an usb cable like it was the OTG connected mouse, I didn’t find anything, there is anyway to archieve this?

Can I use a windows restore usb created on another computer?

If I created a windows 10 restore usb, can I use this to restore a computer other than the one I created it on?

2TB USB drive not showing in diskutil, fsck not running, not showing in Finder

I recently purchased a 2TB USB drive and loaded a few files onto it after formatting it to FAT32 so I could use it on my TV.

I accidentally unplugged it without unmounting/ejecting it first and ever since I have been unable to view it in Finder.

I’ve also tried looking for it with diskutil but it does not show. Also, I have checked for fsck and it is not running on my system. Similarly, the disk does not show in Disk Utility.

I’ve tried plugging it into two separate TVs but it is not recognised on either.

What are my options to try and resuscitate this drive?

diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         121.1 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +121.1 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD — Data     101.7 GB   disk1s1
   2:                APFS Volume Preboot                 81.1 MB    disk1s2
   3:                APFS Volume Recovery                528.7 MB   disk1s3
   4:                APFS Volume VM                      2.1 GB     disk1s4
   5:                APFS Volume Macintosh HD            11.4 GB    disk1s5

Which usb type c ethernet adapter is compatible with ubuntu 20.04?

there is a laptop HP zbook g5, without ethernet port. Ubuntu 20.04 is installed. What kinde of usb ethernet adapter I have to buy?

adb – How do I verify that the USB debugging key fingerprint is correct?

When I try to enable USB debugging on my Android device, I am prompted with this message:

The computer’s RSA key fingerprint is:
FE:35:23:34:…

I see the public key in ~/.android/adbkey.pub

How can I verify that this RSA key fingerprint is correct on the computer’s commandline?

Can I use adb?

Connecting to P2P with USB Tethering

I would like to use Shareaza on Windows 7 with USB Tethered Samsung S7 (rooted) but either a network or some internal firewall is blocking access to both TCP and UDP (does it on any other P2P Network and I2P), any help would be appreciated

Kernel panic error message when trying to boot Ubuntu from USB drive

I’ve been trying to install Ubuntu on my computer for the first time, which runs Windows 10. I have Ubuntu installed on a memory-stick. However, when I try to boot it from the USB drive when I turn on my computer, I just get this kernel panic error message (image attached below). I’ve done a lot of research but can’t get a clear answer and I’m very confused on how to fix this. Not to mention, when I tried to boot Linux Mint 20 to see if it would work (which was installed in a different memory-stick), I got the same error message as shown in the attached image. I would really appreciate it if someone can help me and explain in simple words what the problem could be and also, how it can be fixed.

Thank you in advance
Here’s the link to the kernel panic error message

usb – How to disable bluetooth continuously scan devices on Ubuntu 20.04?

guys. Due to my bluetooth headphone(Audio-Technica ATH-SR30BT) sounds disorted and maybe interrupt when I use Ubuntu 20.04, which I have verified that my headphone is OK via testing it on Windows,

So I google it, and someone said maybe this disorted phenomenon is caused by Ubuntu 20.04 bluetooth continuously scan devices.

So the question is how to disable the bluetooth continuously scan devices?

lsusb
Bus 001 Device 007: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

bluez version: 5.53

Thank you guys in advance!

linux – Iptables rules as script but it blocks usb wifi adapter and vpn

i found this script online , when i execute it, it causes only 2 problems

1 – USB WiFi adapter stay blocked – rules applies only on internal WiFi

2- i can not connect to any VPN

what changes do i have to make inside this script

thanks in advice

#!/bin/sh

###############################################################################

###############################################################################

AWK=which awk
ECHO=which echo
GREP=which grep
IFCONFIG=which ifconfig
IPv4TABLES=which iptables
IPv6TABLES=which ip6tables
LS=which ls
SUDO=which sudo

ROOT_DIR=”/root”

###############################################################################

log() {
if ( $# -gt 0 ); then
now=date "+%x %T"
$ECHO -e “($now) $1”
else
$ECHO
fi
}

###############################################################################

disable() {
for file in $@
do
$SUDO $ECHO 0 > $file
done
}

###############################################################################

enable() {
for file in $@
do
$SUDO $ECHO 1 > $file
done
}

###############################################################################

enable_broadcast_echo_protection() {
if ( -e /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts ); then
log “{IGNORE} tt ICMP echo broadcasts”
enable /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
fi
}

###############################################################################

disable_source_routed_packets() {
if ( -e /proc/sys/net/ipv4/conf/all/accept_source_route ); then
log “{DISABLE} tt source route”
for iter in /proc/sys/net/ipv4/conf/*/accept_source_route
do
disable $iter
done
fi
}

###############################################################################

disable_icmp_redirects() {
if ( -e /proc/sys/net/ipv4/conf/all/accept_redirects ); then
log “{DISABLE} tt ICMP redirects”
for iter in /proc/sys/net/ipv4/conf/*/accept_redirects
do
disable $iter
done
fi
}

###############################################################################

disable_ip_forwarding() {
if ( -e /proc/sys/net/ipv4/ip_forward ); then
log “{DISABLE} tt IP forwarding”
disable /proc/sys/net/ipv4/ip_forward
fi
}

###############################################################################

enable_source_address_verification() {
if ( -e /proc/sys/net/ipv4/conf/all/rp_filter ); then
log “{ENABLE} tt reverse path filtering”
for iter in /proc/sys/net/ipv4/conf/*/rp_filter
do
enable $iter
done
fi
}

###############################################################################

enable_tcp_syn_cookies() {
if ( -e /proc/sys/net/ipv4/tcp_syncookies ); then
log “{ENABLE} tt SYN cookies protetion”
enable /proc/sys/net/ipv4/tcp_syncookies
fi
}

###############################################################################

drop_IANA_reserved_ips() {
iptables_bin=$1
log “{DROP} INCOMING: ttt all IANA reserved IPs”

$SUDO ${iptables_bin} -A INPUT -s 0.0.0.0/7 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 2.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 5.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 7.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 10.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 23.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 27.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 31.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 36.0.0.0/7 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 39.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 42.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 49.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 50.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 77.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 78.0.0.0/7 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 92.0.0.0/6 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 96.0.0.0/4 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 112.0.0.0/5 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 120.0.0.0/8 -j DROP
# $SUDO ${iptables_bin} -A INPUT -s 127.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 169.254.0.0/16 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 172.16.0.0/12 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 173.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 174.0.0.0/7 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 176.0.0.0/5 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 184.0.0.0/6 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 192.0.2.0/24 -j DROP
# $SUDO ${iptables_bin} -A INPUT -s 192.168.0.0/16 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 197.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 198.18.0.0/15 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 223.0.0.0/8 -j DROP
$SUDO ${iptables_bin} -A INPUT -s 224.0.0.0/3 -j DROP

}

###############################################################################

enable_log_martians() {
if ( -e /proc/sys/net/ipv4/conf/all/log_martians ); then
log “{ENABLE} tt log for all unroutable packets”
for iter in /proc/sys/net/ipv4/conf/*/log_martians
do
enable $iter
done
fi
}

###############################################################################

disable_enable_kernel_features() {
enable_broadcast_echo_protection
enable_log_martians
enable_source_address_verification
enable_tcp_syn_cookies

disable_icmp_redirects
disable_ip_forwarding
disable_source_routed_packets

}

###############################################################################

clear_all_rules() {
log “clear all rules”

iptables_bin=$1

# default table is filter
$SUDO ${iptables_bin} -F -t filter
$SUDO ${iptables_bin} -F -t nat
$SUDO ${iptables_bin} -F -t mangle

}

###############################################################################

default_drop_all() {
log “default drop”

iptables_bin=$1

# filter table
$SUDO ${iptables_bin} -t filter -P INPUT DROP
$SUDO ${iptables_bin} -t filter -P OUTPUT DROP
$SUDO ${iptables_bin} -t filter -P FORWARD DROP

# mangle table
$SUDO ${iptables_bin} -t mangle -P PREROUTING DROP
$SUDO ${iptables_bin} -t mangle -P INPUT DROP
$SUDO ${iptables_bin} -t mangle -P OUTPUT DROP
$SUDO ${iptables_bin} -t mangle -P FORWARD DROP
$SUDO ${iptables_bin} -t mangle -P POSTROUTING DROP

}

###############################################################################

log_all_dropped_incoming() {
log “t {LOG} INCOMING: tt all dropped”

iface=$1
iptables_bin=$2

# filter table
${SUDO} ${iptables_bin} -t filter -A INPUT -i ${iface} -m limit --limit 2/min -j LOG --log-prefix "{INPUT-filter-Dropped} " --log-level 7

# mangle table
${SUDO} ${iptables_bin} -t mangle -A INPUT -i ${iface} -m limit --limit 2/min -j LOG --log-prefix "{INPUT-mangle-Dropped} " --log-level 7

}

###############################################################################

log_all_dropped_outgoing() {
log “t {LOG} OUTGOING: tt all dropped”

iface=$1
iptables_bin=$2

# filter table
${SUDO} ${iptables_bin} -t filter -A OUTPUT -o ${iface} -m limit --limit 2/min -j LOG --log-prefix "{OUTPUT-filter-Dropped} " --log-level 7

# mangle table
${SUDO} ${iptables_bin} -t mangle -A OUTPUT -o ${iface} -m limit --limit 2/min -j LOG --log-prefix "{OUTPUT-mangle-Dropped} " --log-level 7

}

###############################################################################

allow_related_established() {
log “{ALLOW} INCOMING & OUTGOING: t related & established packets”

iptables_bin=$1

# filter table
$SUDO ${iptables_bin} -t filter -I INPUT 1 -m state --state RELATED,ESTABLISHED -j ACCEPT
$SUDO ${iptables_bin} -t filter -I OUTPUT 1 -m state --state RELATED,ESTABLISHED -j ACCEPT

# mangle table
$SUDO ${iptables_bin} -t mangle -I PREROUTING 1 -m state --state RELATED,ESTABLISHED -j ACCEPT
$SUDO ${iptables_bin} -t mangle -I INPUT 1 -m state --state RELATED,ESTABLISHED -j ACCEPT
$SUDO ${iptables_bin} -t mangle -I OUTPUT 1 -m state --state RELATED,ESTABLISHED -j ACCEPT
$SUDO ${iptables_bin} -t mangle -I POSTROUTING 1 -m state --state RELATED,ESTABLISHED -j ACCEPT

}

###############################################################################

allow_loopback() {
log “{ALLOW} INCOMING & OUTGOING: t loopback interface”

iptables_bin=$1

# filter table
$SUDO ${iptables_bin} -t filter -A INPUT -i lo -j ACCEPT
$SUDO ${iptables_bin} -t filter -A OUTPUT -o lo -j ACCEPT

# mangle table
$SUDO ${iptables_bin} -t mangle -A PREROUTING -i lo -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A INPUT -i lo -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A OUTPUT -o lo -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A POSTROUTING -o lo -j ACCEPT

}

###############################################################################

allow_DHCP_out() {
log “t {ALLOW} OUTGOING: tt DHCP”

iface=$1
iptables_bin=$2

$SUDO ${iptables_bin} -t filter -A OUTPUT -o ${iface} -p udp --dport 67:68 --sport 67:68 -j ACCEPT

}

###############################################################################

allow_SSH_in() {
log “t {ALLOW} INCOMING: tt SSH”

iface=$1
iptables_bin=$2

# filter table
$SUDO ${iptables_bin} -t filter -A INPUT -i ${iface} -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT

# mangle table
$SUDO ${iptables_bin} -t mangle -A INPUT -o ${iface} -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A PREROUTING -o ${iface} -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT

}

###############################################################################

allow_SSH_out() {
log “t {ALLOW} OUTGOING: tt SSH”

iface=$1
iptables_bin=$2

# filter table
$SUDO ${iptables_bin} -t filter -A OUTPUT -o ${iface} -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT

# mangle table
$SUDO ${iptables_bin} -t mangle -A OUTPUT -o ${iface} -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A POSTROUTING -o ${iface} -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT

}

###############################################################################

allow_WHOIS_out() {
log “t {ALLOW} OUTGOING: tt WHOIS”

iface=$1
iptables_bin=$2

# filter table
$SUDO ${iptables_bin} -t filter -A OUTPUT -o ${iface} -p tcp -m tcp --dport 43 -m state --state NEW -j ACCEPT

# mangle table
$SUDO ${iptables_bin} -t mangle -A OUTPUT -o ${iface} -p tcp -m tcp --dport 43 -m state --state NEW -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A POSTROUTING -o ${iface} -p tcp -m tcp --dport 43 -m state --state NEW -j ACCEPT

}

###############################################################################

allow_SMTP_out() {
log “t {ALLOW} OUTGOING: tt SMTP”

iface=$1
iptables_bin=$2

$SUDO ${iptables_bin} -t filter -A OUTPUT -o ${iface} -p tcp -m tcp --dport 25 -m state --state NEW -j ACCEPT

}

###############################################################################

allow_DNS_out() {
log “t {ALLOW} OUTGOING: tt DNS”

iface=$1
iptables_bin=$2

# filter table
$SUDO ${iptables_bin} -t filter -A OUTPUT -o ${iface} -p udp -m udp --dport 53 -j ACCEPT

# mangle table
$SUDO ${iptables_bin} -t mangle -A OUTPUT -o ${iface} -p udp -m udp --dport 53 -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A POSTROUTING -o ${iface} -p udp -m udp --dport 53 -j ACCEPT

}

###############################################################################

allow_ping_in() {
log “{ALLOW} INCOMING: tt ping”

iface=$1
iptables_bin=$2

# filter table
$SUDO ${iptables_bin} -t filter -A INPUT -i ${iface} -p icmp --icmp-type echo-reply -j ACCEPT

# mangle table
$SUDO ${iptables_bin} -t mangle -A PREROUTING -i ${iface} -p icmp --icmp-type echo-reply -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A INPUT -i ${iface} -p icmp --icmp-type echo-reply -j ACCEPT

}

###############################################################################

allow_ping_out() {
log “t {ALLOW} OUTGOING: tt ping”

iface=$1
iptables_bin=$2

# filter table
$SUDO ${iptables_bin} -t filter -A OUTPUT -o ${iface} -p icmp --icmp-type echo-request -j ACCEPT

# mangle table
$SUDO ${iptables_bin} -t mangle -A OUTPUT -o ${iface} -p icmp --icmp-type echo-request -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A POSTROUTING -o ${iface} -p icmp --icmp-type echo-request -j ACCEPT

}

###############################################################################

allow_NTP_out() {
log “t {ALLOW} OUTGOING: tt NTP”

iface=$1
iptables_bin=$2

$SUDO ${iptables_bin} -t filter -A OUTPUT -o ${iface} -p udp --dport 123 --sport 123 -j ACCEPT

}

###############################################################################

allow_HTTP_out() {
log “t {ALLOW} OUTGOING: tt HTTP”

iface=$1
iptables_bin=$2

# filter table
$SUDO ${iptables_bin} -t filter -A OUTPUT -o ${iface} -p tcp --dport 80 -m state --state NEW -j ACCEPT
$SUDO ${iptables_bin} -t filter -A OUTPUT -o ${iface} -p tcp --dport 443 -m state --state NEW -j ACCEPT

# mangle table
$SUDO ${iptables_bin} -t mangle -A OUTPUT -o ${iface} -p tcp --dport 80 -m state --state NEW -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A OUTPUT -o ${iface} -p tcp --dport 443 -m state --state NEW -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A POSTROUTING -o ${iface} -p tcp --dport 80 -m state --state NEW -j ACCEPT
$SUDO ${iptables_bin} -t mangle -A POSTROUTING -o ${iface} -p tcp --dport 443 -m state --state NEW -j ACCEPT

}

###############################################################################

allow_skype_in() {
log “t {ALLOW} INCOMING: tt skype”

iface=$1
iptables_bin=$2

$SUDO ${iptables_bin} -t filter -A INPUT -i ${iface} -p udp --dport 16514 -j ACCEPT
$SUDO ${iptables_bin} -t filter -A INPUT -i ${iface} -p tcp --dport 16514 -j ACCEPT

}

###############################################################################

firewall_all_ifaces() {
iptables_bin=$1

INET_FACES=`$IFCONFIG -s | $GREP -vi 'kernel' | $GREP -vi 'iface' | $GREP -v 'lo' | $AWK '{print $1}'`
for iface in $INET_FACES
do
    log "============== ${iface} =============="

    # allow incoming requests
    #allow_SSH_in ${iface}
    #allow_ping_in ${iface}
    allow_skype_in ${iface} ${iptables_bin}

    # allow outcoming requests
    allow_DHCP_out ${iface} ${iptables_bin}
    allow_DNS_out ${iface} ${iptables_bin}
    allow_HTTP_out ${iface} ${iptables_bin}
    allow_NTP_out ${iface} ${iptables_bin}
    allow_ping_out ${iface} ${iptables_bin}
    allow_SMTP_out ${iface} ${iptables_bin}
    allow_SSH_out ${iface} ${iptables_bin}
    allow_WHOIS_out ${iface} ${iptables_bin}

    # has to be the last rules to catch only the dropped packets
    log_all_dropped_incoming ${iface} ${iptables_bin}
    log_all_dropped_outgoing ${iface} ${iptables_bin}
done

}

###############################################################################

is_root() {
$LS $ROOT_DIR >/dev/null 2>/dev/null
return $?
}

###############################################################################

main() {
if ( “x$(is_root)” != “x0” ); then
log “Not a root!”
fi

log
log "-------------- KERNEL FEATURES ---------------"
disable_enable_kernel_features

# Handle IPv4 based firewall
if ( ! -z $IPv4TABLES ); then
    log
    log "-------------- IPv4 ---------------"
    clear_all_rules $IPv4TABLES
    default_drop_all $IPv4TABLES
    allow_related_established $IPv4TABLES
    allow_loopback $IPv4TABLES
    drop_IANA_reserved_ips $IPv4TABLES
    firewall_all_ifaces $IPv4TABLES
fi

# Handle IPv6 based firewall
if ( ! -z $IPv6TABLES ); then
    log
    log "-------------- IPv6 ---------------"
    clear_all_rules $IPv6TABLES
    default_drop_all $IPv6TABLES
fi

}

#set -x
main