curl-ing the weather

wttr.in

In need for quick weather forecast? Use:

curl wttr.in/<your city>

Excellent little web service based on wego and wttr.in, a web frontend for wego.

You can also use installed wego directly by obtaining  API key from here and editing ~/.wegorc like:

{
"APIKey": "",
"City": "",
"Numdays": 5,
"Imperial": false,
"Lang": "en"
}

….and you get weather forecast for five days.

wego

Happy hacking….

Advertisements

kodi – network ports

kodi-helix-14.1-600x336

If you use XBMC or now Kodi, those are the ports that should be open for full network access:
tcp 8080 – web interface, can be changed,
udp 1900 – dlna,
other ports:
tcp: 1084, 1308, 1131,
tcp (ipv6): 9090 (optional if you use ipv6 connections),
udp: 9777, 12374.
Those are ports that I opened and can be seen with console command:
netstat -ntulp
If you use iptables those are commands:

iptables -A TCP -p tcp --match multiport --dports 1084,1131,1308,8080 -m comment --comment "kodi" -j ACCEPT
iptables -A UDP -p udp --match multiport --dports 1900,9777,12374 -m comment --comment "kodi" -j ACCEPT
iptables-save > /etc/iptables/iptables.rules
systemctl reload iptables

…as root.
Happy hacking…

hstr – improved bash history completition

hh>

When working on command line most of the time, there is always a problem with long commands, for example:
find . -depth -name '* *' -execdir bash \-c 'a="{}";mv -f "$a" ${a// /.}' \;
(this command replace all spaces ‘ ‘ with dots ‘.’ recursively in directories and file names, see my post for explanation)

There is option with ctrl-r or you can use clipboard manager like anamnesis or CopyQ or some other helper. A while ago I stumbled upon hstr on ArchLinux AUR repository (it’s called hh there) and I’m using it since then. The advantages are easier and more efficient browsing with managed history (removing sensitive commands) and option to bookmark favorite commands.
When installed just configure hh with:
hh --show-configuration >> ~/.bashrc
and with the same ctrl-r keyboard shortcut.

For quick introduction you can view video tutorial on Youtube or, when installed read man hh.

Happy hacking….

goto – enhanced cd command

archlinux-logo-dark-200dpi.b42bd35d5916

goto – enhanced ‘cd’ command replacement tool with fuzzy file finder and a directory bookmark saver, similar to autojump.

The usage is simple and effective:

goto -h, -help, h, help  # Prints the Usage

goto "location address"  # Takes you to the "location address"

goto s, -s "shortcut"  # Saves the Current Directory location as "shortcut"

goto l, -l  # Lists all the Bookmarks saved

goto d, -d "shortcut"  # Deletes the "shortcut" saved

goto p, -p "shortcut"   # Prints the GOTO directory for "shortcut"

goto f, -f, find, -find "term"  # Fuzzy-Finds all the file/folder matching REGEX in the working directory

Give it a try…

…and happy hacking.

world in ASCII code

asciiworld

asciiworld – that’s how world is represented in ASCII code. Interesting project which come equiped with some interesting tools: geoIP, day/night, satelite tracking, different world projections.

If you are on ArchLinux instalation is simple, just use AUR repository, for others compiling is the option, just read README files and Makefile for dependencies.

Anything else…, oh yes, the words of author vain aka.Peter Hofman: “Having a little bit of fun.”

Happy hacking….

cool-retro-term – cathode tube screen is back

fun-retro-terminal cool-retro-term-1

Lets face it, it is not meant to be default working terminal and can’s replace it, but it is fun, big tima fun and more like a game typing commands into old school screen. Cool-retro-term is written in the C++, use Qt GUI toolkit with qmltermwidget, a QML port of the qtermwidget class from the Konsole terminal emulator, was tested on various Linux distributions and can be found in their repositories.

9 predefined profiles are available via menu bar or context menu and you can make your own profile, changing default screen, font, effects and performance settings settings.

Give it a try, it’s fun…

…and happy hacking…

pyhn – issue #31 repair

pyhn

New version is out, dealing with issue #31:
$ pyhn
Traceback (most recent call last):
File "/usr/local/bin/pyhn", line 8, in
hn_gui.main()
File "/usr/local/lib/python2.7/dist-packages/pyhn/gui.py", line 85, in main
self.build_interface()
File "/usr/local/lib/python2.7/dist-packages/pyhn/gui.py", line 124, in build_interface
self.cache_manager.refresh()
File "/usr/local/lib/python2.7/dist-packages/pyhn/cachemanager.py", line 44, in refresh
stories = self.api.getTopStories(extra_page=self.extra_page)
File "/usr/local/lib/python2.7/dist-packages/pyhn/hnapi.py", line 307, in getTopStories
stories += self.getStories(source_latest)
File "/usr/local/lib/python2.7/dist-packages/pyhn/hnapi.py", line 240, in getStories
storyNumber = self.getStoryNumber(story)
File "/usr/local/lib/python2.7/dist-packages/pyhn/hnapi.py", line 101, in getStoryNumber
return int(source[numberStart:numberEnd])
ValueError: invalid literal for int() with base 10: '1'

Download:
python
…or…
github
…see also:
pyhn

Happy hacking….