- Look up the interface
$ sudo iw dev
phy#0
Unnamed/non-netdev interface
wdev 0x3
addr 98:54:1b:0a:9f:16
type P2P-device
txpower 0.00 dBm
$ sudo iw dev
phy#0
Unnamed/non-netdev interface
wdev 0x3
addr 98:54:1b:0a:9f:16
type P2P-device
txpower 0.00 dBm
Install package hplip
Run
hp-setup -i
Download hplip-3.20.3-plugin.run from here.
Developers fix thousands of defects in their careers. However, there are always a memorable few. I thought of listing down some of the interesting bugs I came across so far.
One from the early years of my career. I was working on SMS/MMS protocols during the time, After sending out a few lakhs of messages from one handled to another kept beside each other it was seen that even before the message is sent completely from mobile A it reaches mobile B and the user gets the notification.
It was late night but a challenge interesting enough to keep you awake. After a few hours of debugging it was found that the implementation was using a linked list to which it was appending each new message information at the end before sending it out to the lower telephony layer which would confirm asynchronously once the message was successfully sent. However, on receiving the confirmation, it does some bookkeeping and it was searching the list from the head f
List the network devices.
$ ls /sys/class/net
eth0 lo wlan0
Edit the config file.
import os | |
import re | |
def fish_to_zsh(cmd): | |
return (cmd.replace('; and ', '&&') | |
.replace('; or ', '||')) | |
with open(os.path.expanduser('~/.zsh_history.test'), 'a') as o: | |
with open(os.path.expanduser('~/.local/share/fish/fish_history')) as f: | |
for line in f: |
$ errno -l
EPERM 1 Operation not permitted
ENOENT 2 No such file or directory
#!/usr/bin/env sh | |
# Description: POSIZ compliant script to get the size to duration of a media file | |
# Requires: mediainfo, bc, ls | |
# | |
# For sorted output: ratio.sh | sort -rg | |
for file in *; do | |
# get duration in milliseconds->mins | |
ms=$(mediainfo --Inform="Video;%Duration%" "$file") |
#!/usr/bin/env python3 | |
''' | |
Description: split a music track into specified sub-tracks using ffmpeg | |
target files are saved as variable bit-rate mp3 (lossless) | |
Usage: split <original_track> <track_list> | |
''' | |
import shlex |
In this example, we will setup a SSH server on Termux (for Android) and connect to the server from Ubuntu desktop. However, a similar procedure should work with any SSH server.
Generate your ssh key pair on your desktop
$ ssh-keygen
Check your desktop IP address (say, 192.168.0.100)
Run ssh server on your desktop
Copy the file to Termux over SCP
$ scp [email protected]:~/.ssh/id_rsa.pub ~/.ssh/authorized_keys