bluetooth – bluetoothctl service on ubuntu

  • Check service status
systemctl status bluetooth.service


● bluetooth.service - Bluetooth service
     Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; preset: enabled)
     Active: active (running) since Fri 2025-03-21 07:57:38 IST; 1min 18s ago
       Docs: man:bluetoothd(8)
   Main PID: 21633 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 76673)
     Memory: 1.1M (peak: 1.6M)
        CPU: 55ms
     CGroup: /system.slice/bluetooth.service
             └─21633 /usr/libexec/bluetooth/bluetoothd
  • For monitoring events on Bluetooth
root@home:~# bluetoothctl
bluetooth]# [NEW] Device F4:C8:8A:7F:xx:xx CP250003
[bluetooth]# hci0 type 7 discovering off
[bluetooth]# hci0 type 7 discovering on
[bluetooth]# hci0 type 7 discovering off
[bluetooth]# hci0 type 7 discovering on
[bluetooth]# [DEL] Device F4:C8:8A:7F:xx:xx CP250003
[bluetooth]# [NEW] Device F4:C8:8A:7F:xx:xx CP250003
[bluetooth]# hci0 type 7 discovering off
[bluetooth]# hci0 type 7 discovering on
[bluetooth]# [CHG] Device D0:49:7C:8F:xx:xx RSSI: 0xffffffab (-85)



list                                              List available controllers
show [ctrl]                                       Controller information
select <ctrl>                                     Select default controller
devices [Paired/Bonded/Trusted/Connected]         List available devices, with an optional property as the filter
system-alias <name>                               Set controller alias
reset-alias                                       Reset controller alias
power <on/off>                                    Set controller power
pairable <on/off>                                 Set controller pairable mode
discoverable <on/off>                             Set controller discoverable mode
discoverable-timeout [value]                      Set discoverable timeout
agent <on/off/auto/capability>                    Enable/disable agent with given capability
default-agent                                     Set agent as the default one
advertise <on/off/type>                           Enable/disable advertising with given type
set-alias <alias>                                 Set device alias
scan <on/off/bredr/le>                            Scan for devices
info [dev/set]                                    Device/Set information
pair [dev]                                        Pair with device
cancel-pairing [dev]                              Cancel pairing with device
trust [dev]                                       Trust device
untrust [dev]                                     Untrust device
block [dev]                                       Block device
unblock [dev]                                     Unblock device
remove <dev>                                      Remove device
connect <dev>                                     Connect device
disconnect [dev]                                  Disconnect device
menu <name>                                       Select submenu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
export                                            Print environment variables

rocky linux enable time sync – ntp timedatectl

[root@lp-knode-1 ~]# date
Tue Mar  4 19:32:46 IST 2025

[root@lp-knode-1 ~]# timedatectl
               Local time: Tue 2025-03-04 19:33:01 IST
           Universal time: Tue 2025-03-04 14:03:01 UTC
                 RTC time: Tue 2025-03-04 14:27:56
                Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no


[root@lp-knode-1 ~]# timedatectl set-ntp on
[root@lp-knode-1 ~]# timedatectl status
               Local time: Tue 2025-03-04 20:00:13 IST
           Universal time: Tue 2025-03-04 14:30:13 UTC
                 RTC time: Tue 2025-03-04 14:30:13
                Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

[root@lp-knode-1 ~]# date
Tue Mar  4 20:00:17 IST 2025

Crack zip lock password and passwd in linux

@home:~/Downloads$ zip-password-finder -i mahuli6.zip --minPasswordLen=6 --maxPasswordLen=6 --fileNumber=1 -c=d -w=12
Targeting file 'mahuli/mahuli-bg.jpg' within the archive
Archive encrypted with AES256 - expect a long wait time
Starting 12 workers to test passwords
Generating passwords with length from 6 to 6 for charset with length 10
0123456789
Starting search space for password length 6 (1000000 possibilities) 
Time elapsed: 2m 51s 256ms 948us 212ns
Password found:666666
unshadow /etc/passwd  /etc/shadow > pass.txt
user@home:~$ john pass.txt
user@home:~$ john pass.txt --show
abc1:11111111:1000:1000:abc1:/home/abc1:/bin/bash
abc2:22222222:1002:1002:,,,:/home/abc2:/bin/bash


user@home:~$ ls .john/
john.log  john.pot

Note: Don’t use simple password.

boot order – Raspbery pi

  • Edit boot order(read from right to left)
1. 4 = Read from USB
2. 1 = Read from SD Card
3. 0xf = Restart boot order

rpi-eeprom-config -e
ValueModeDescription
0x0SD CARD DETECTTry SD then wait for card-detect to indicate that the card has changed – deprecated now that 0xf (RESTART) is available.
0x1SD CARDSD card (or eMMC on Compute Module 4).
0x2NETWORKNetwork boot – See Network boot server tutorial
0x3RPIBOOTRPIBOOT – See usbboot
0x4USB-MSDUSB mass storage boot – See USB mass storage boot
0x5BCM-USB-MSDUSB 2.0 boot from USB Type C socket (CM4: USB type A socket on CM4IO board). Not available on Raspberry Pi 5.
0x6NVMECM4 and Pi 5 only: boot from an NVMe SSD connected to the PCIe interface. See NVMe boot for more details.
0x7HTTPHTTP boot over ethernet. See HTTP boot for more details.
0xeSTOPStop and display error pattern. A power cycle is required to exit this state.
0xfRESTARTRestart from the first boot-mode in the BOOT_ORDER field i.e. loop

boot order: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#BOOT_ORDER

Skopeo – Copy multi arch image from one registry to another registry

login to the repository:

[home@home ~]$ skopeo login --username $USER docker.io
Password: 
Login Succeeded!

Copy:

skopeo copy -a docker://nginx docker://$USER/nginx

References:

rysnc –partial , -P is awesome


[home@home Downloads]$ time rsync -parvP ubuntu-20.04.4-live-server-amd64.iso root@192.168.0.183:/tmp
sending incremental file list
ubuntu-20.04.4-live-server-amd64.iso
    646,053,888  48%   11.15MB/s    0:01:00  ^C
rsync error: unexplained error (code 255) at rsync.c(703) [sender=3.2.3]

real	0m56.958s
user	0m6.159s
sys	0m2.564s





[home@home Downloads]$ time rsync -parvP ubuntu-20.04.4-live-server-amd64.iso root@192.168.0.183:/tmp
sending incremental file list
ubuntu-20.04.4-live-server-amd64.iso
  1,331,691,520 100%   20.02MB/s    0:01:03 (xfr#1, to-chk=0/1)

sent 658,982,006 bytes  received 178,830 bytes  9,765,345.72 bytes/sec
total size is 1,331,691,520  speedup is 2.02

real	1m6.846s
user	0m27.066s
sys	0m1.862s
[home@home Downloads]$ time rsync -parv ubuntu-20.04.4-live-server-amd64.iso root@192.168.0.183:/tmp
sending incremental file list
ubuntu-20.04.4-live-server-amd64.iso

sent 1,332,016,766 bytes  received 35 bytes  11,633,334.51 bytes/sec
total size is 1,331,691,520  speedup is 1.00

real	1m54.871s
user	0m6.400s
sys	0m3.748s