Finding files in Linux

the Linux “find” command will give you a lot of ‘Permission denied’ messages when searching your whole hard drive. One workaround for this is to create a custom script, we’ll call it ‘myfind’ that suppresses these messages.

In terminal, type:
sudo nano /usr/local/bin/myfind

Then type:

#!/bin/bash
find $1 -name $2 2>/dev/null

then save o
and exit nano x
and type
sudo chmod +x /usr/local/bin/myfind

To find a file, say MyDoc.ods, type in terminal (from anywhere)
myfind / MyDoc.ods
That searches the whole hard drive (any external/network mounted drives as well)

If you only want to search under your home directory, type:
find ~ MyDoc.ods

The “myfind” Permission denied suppression is only necessary when searching all the directories such as external drives at once.

using wakeonlan with Linux–from outside LAN (worldwide)

On target (PC to be remotely controlled) do:

  1. sudo apt-get ethtool
  2. backup your /etc/network/interfaces file:
    sudo cp /etc/network/interfaces /etc/network/interfaces.backup

  3. sudo nano /etc/network/interfaces
    You should see a segment that looks like the following. If not, try adding it. Note, if this goofs up, you may not have network access for your machine until you copy the .backup file you made in the previous step!

    auto eth0
    iface eth0 inet dhcp
    up ethtool -s eth0 wol g

  4. sudo nano /etc/init.d/halt
    change the text near the top of the file to say
    NETDOWN=no
    instead of yes.
  5. type ifconfig and note HWaddr for eth0–this is MAC address
  6. Reboot remote PC, then shutdown remote PC

—————————
On controlling PC, do:
sudo apt-get install wakeonlan

To wakeup remote PC, on your control PC (while on the same LAN), type
wakeonlan HWaddr
WHERE HWaddr is the MAC address of the remote PC

E.g. if HWaddr of remote PC is 00:11:22:33:44:55
then type on the control PC (on the same LAN):
wakeonlan 00:11:22:33:44:55

———–
Now, that you have that working, let’s do the worldwide version.
You will need to have Port Forwarding capability to your PC from your router
Otherwise, you would have to be on the same subnet–perhaps via VPN.

Let’s assume your remote PC is assigned the DHCP reserved address 192.168.1.100 by your router. Let’s also assume you forwarded say port 1234 to port 22 for SSH/RDP control.

Now, setup your router to forward a second port, say 4321 for UDP packets to port 9 (port 9 is Wake on Lan magic packet port), to 129.168.1.100.

Finally, you need to know the WAN (world-facing) address of your router–this needs to be relatively fixed, or use one of the “DynDNS” type services. These days it seems a lot of internet providers keep the same IP addresses for their customers for long periods of time (years). Let’s say you used whatismyip.com to find that your WAN address is 10.90.80.1 (yes, this example IP is for private networks–I deliberately chose an invalid WAN address for this example)

From your control PC (which will now need to be on a different network to really test–use your 3G modem or VPN to another network, or just go to the local coffeeshop WLAN) and type in Terminal:

wakeonlan -i 10.90.80.1 -p 4321 00:11:22:33:44:55

and your PC should have powered itself on.

If it didn’t, try it first using just the LAN with the earlier example–you need to check your BIOS/UEFI settings so that Wake On Lan is enabled. Worst case, you may need to try a discrete Intel Ethernet NIC, available cheaply these days (~$30 at Newegg et al).

Reference:

https://help.ubuntu.com/community/WakeOnLan

rigctl / hamlib with Kenwood TS-2000

On a modern PC, you may notice intermittent errors with the Kenwood TS-2000 , something like:
read_string(): Timed out 0.2 seconds without reading a character.

The solution seems to be making rigctl wait for the TS-2000 to catchup by using the hardware handshake–you need a “real” RS232 cable for this to work, with the correct DSR/RTS pins included and connected.

try the command:
rigctl -m 214 -s 57600 -r COM1 -C serial_handshake=Hardware

Unicode characters in Draftsight V1R3: Ubuntu

While the ttf-linux-libertine package provides a great looking font that works in most Ubuntu programs, for Draftsight the font I’ve found that supports many special Unicode characters (e.g. with tildes over letters) is GNU Freefont otf-freefont

To use GNU Freefont for Unicode in Draftsight, add some text by typing MT at the Draftsight Command Line (window) and then select the “FreeSans” or “FreeMono” font.

To actually enter the Unicode characters, find a table showing the Unicode character code you need–e.g. for tilde over character, see Wikipedia and do:

Hold <ctrl><shift>  while typing
u00f1 for ñ (n with tilde)
u1ebc for Ẽ (E with tilde)

and so on.