Both the shell and Python methods get public IPv4 and IPv6 addresses.
This is good for verifying the computer IP is in the organization’s IP address range.
These scripts use the “reflector” method, which can be more reliable on complex networks.
Shell: specify the network interface with curl --interface eth0 option.
url=('https://ident.me''https://api.ipify.org')
for u in ${url[@]}; do curl -6 -s -m 2$u && breakdonefor u in ${url[@]}; do curl -4 -s -m 2$u && breakdone
#!/usr/bin/env python"""
gets interface IPv4 and IPv6 public addresses using libCURL
This uses the "reflector" method, which seems more reliable for finding public-facing IP addresses,
WITH THE CAVEAT that man-in-the-middle, etc. attacks can defeat the reflector method.
"""fromipaddressimport ip_address
importpycurlfromioimport BytesIO
urls = ['https://ident.me', # ipv6 and ipv4'https://api.ipify.org'] # ipv4 onlylength=45# https://stackoverflow.com/questions/166132/maximum-length-of-the-textual-representation-of-an-ipv6-addressdefgetip(interface=None):
for url in urls:
addr = []
for ipv in (pycurl.IPRESOLVE_V4,pycurl.IPRESOLVE_V6):
buffer = BytesIO() # must clear like this C = pycurl.Curl()
if interface:
C.setopt(pycurl.INTERFACE,interface)
C.setopt(C.URL, url)
C.setopt(pycurl.IPRESOLVE, ipv)
C.setopt(C.WRITEDATA, buffer)
try:
C.perform()
result = buffer.getvalue()
try: #validate response addr.append(ip_address(result.decode('utf8')))
exceptValueError:
passexcept pycurl.error:
passfinally:
C.close()
iflen(addr)>1: #IPv4 and IPv6 foundbreakreturn addr
if__name__ == '__main__':
importsignal signal.signal(signal.SIGINT, signal.SIG_DFL)
fromargparseimport ArgumentParser
p = ArgumentParser()
p.add_argument('-i','--iface',help='network interface to use')
p = p.parse_args()
addr = getip(p.iface)
print(addr)
Easily record the sounds heard through system speakers on Linux with Pulseaudio and Audacity.
apt install audacity pavucontrol
To record “what you hear” in Audacity: “click to monitor” (right of microphone in main Audacity screen).
Start Pulseaudio advanced configuration tool
pavucontrol
Under pavucontrol Recording tab input, select “Monitor of Built-in XXX” where XXX is the playback device you wish to monitor.
This loopback audio from pavucontrol allows recording what you hear in Linux using Audacity and PulseAudio.
On Windows, Adobe Reader can export and view a list of comments through the Comment tab on the right side.
On Linux, in Evince PDF viewer, the side pane has a drop-down annotations menu that lists comments.
Press F9 key if you don’t see the left-hand panel.
One can extract all comments and annotations from a PDF file by
It’s often useful to open the same PDF file multiple times, particularly when reviewing journal article drafts to view figures simultaneously with text describing the figure.
From Evince (popular Linux PDF viewer), Menu select “Open a Copy”.
Open as many copies of the same Postscript or PDF document as desired.
Enable syntax highlighting:
Before every code block, simply include the language name, for example
```fortran
this even works for gdb.
The color code syntax highlighting on your webpage looks quite striking, and the number of languages covered is very extensive.
Despite the different syntax highlighter modules used by different Jekyll web hosting services, almost every language works with the method above.
Github uses Linguist syntax highlighting for its own service (Issues, README.md, etc.)
Github/Gitlab Pages can use Rouge syntax highlighting via Jekyll _config.yml – specify an allowed syntax highlighter.
At first glance, the two watt transmit power limit across five VHF channels can make MURS seem appealing for long-range license-free radio systems.
In fact, companies such as GoTenna initially chose MURS for their first generation product.
The clear choice for almost all applications is to use 900 MHz modems over MURS 150 MHz modems.
Contact us for a more formal analysis for your application.
MURS data bandwidth:
Freq [MHz]
raw data rate (kbps)
151.82
9600
151.88
9600
151.94
9600
154.57
19200
154.60
19200
At first glance, MURS seems to have a comparable data rate to the $39 one watt 868/900/920 MHz modems, and similar hardware pricing, with seemingly longer range due to 150 MHz vs. 900 MHz frequency.
Interference limits data throughput.
MURS arose in part because of the decades-long abuse of these five VHF itinerant frequencies.
Like the delicensing of 27 MHz CB Radio, the license-free MURS channels arose due to chronic unlicensed use.
Warehouses, hotels, shopping malls, construction sites, etc. use MURS frequencies.
The critical point is that in general MURS modems are stuck on one frequency until reprogrammed.
$14 walkie talkies meanwhile are clogging up the channels.
Cable TV leakage is also a problem at VHF.
Many applications of wireless modems have a latency requirement–how long will an MURS channel be blocked by noise and other users?
The answer comes in using 900 MHz spread-spectrum radio.
900 MHz is also a heavily used frequency band.
The key distinction is this use is spread over as much as 26 MHz (USA).
The one watt transmit power allowed in the USA and numerous other countries, and tens of milliwatts in other countries allows multi-kilometer line-of-sight range, just like 150 MHz radios.
Some 900 MHz modems have a channel list where they hop upon interference, while the high power radios typically employ FHSS.
Having a clear RF channel via FHSS is key to getting even low data bandwidth transmissions through reliably with low latency.