Pages

Showing posts with label cli. Show all posts
Showing posts with label cli. Show all posts

21 May 2025

lynx

 I have several things to say beforehand to make my point clear. First is that even though the title of this post is lynx my favourite text browser still is elinks. I think that the configuration options are easier to handle, and I also prefer the layout of some websites as displayed by elinks (I've published several screenshots over time).

Second, if you visit my home page, you'll read:

 chals@chalsattack:~$ elinks -dump chalsattack.com 

But to tell you the truth I use lynx in my scripts.

And one last thing, Make no mistake, graphical web browsers are fantastic, they allow you to access infinite multimedia content, and I do really love them. 

So, if I do really love graphical web browsers and my favourite text browser is elinks. Why then am I writing a post named lynx? 

Well, sometimes the answer to complex questions is quite simple. I am using lynx these days to navigate to certain https:// sites that are not easily reachable with elinks. 

Another easy answer to that question is that I use https://chalsattack.com/ as my homepage in all my browsers, but always using the same homepage can be a bit boring so I wrote some aliases to start lynx with different homepages depending on my needs. This is quite simple, I know, but it is also very handy sometimes:

# lynx aliases & functions

alias lx='lynx https://chalsattack.com/'
alias lxd='lynx https://lite.duckduckgo.com/lite/'
alias lxg='lynx https://www.google.com/'
alias lxf='lynx https://www.filmaffinity.com/es/main.html'
 ...

and several more.

If I simply type lynx I get the browser's default page which leads to https://lynx.invisible-island.net/

To finish with by now, let me add that lynx is still actively maintained and this adds an extra level of trust in the browser.


03 March 2024

Axyl, an OS with i3 by default

Last night I discovered Axyl. An operating system based on ARCH linux and focused on window managers. 

It works well with i3, bspwm, dwm, XMonad, Spectrwm and others, but the default one is i3.

I must say that I only tried it live. But it runs fast and it is pretty cool. I have not installed it because I am too lazy to learn ARCH. I tried ARCH once but only for a little while.

Their official website is https://axyl-os.github.io

As a curiosity. It was developed in Republic of the Philippines. But I do not know anything else about it apart from what I read on Wikipedia.


03 February 2022

Software I discovered in 2021

 Last year I discovered two pieces of software that surprised me: The zsh and byobu

I already wrote a post talking about my experience with zsh here but I haven't really even mentioned byobu anywhere that I remember, except maybe on irc.

byobu is a wrapper for gnu screen or tmux, it really is something you have to try if you like to test new software. It can do many many things, and learning them all is a bit challenging at first because it is mainly managed using your keyboard's F keys and you need to learn them by heart. However you only need to know two basic keystrokes:

F2 opens a new window (similar to ctrl + a + c in screen/tmux)

F6 dettaches your session (similar to ctrl + a + d in screen/tmux)

Heed that these two keys are only the two basic commands. F3 and F4 move form one window to the other up and down. Want to learn more? I am sure you do...

Enjoy

27 January 2022

The truth about the zsh

 I heard wonderful things about the zsh and the wannabe geek in me couldn't help installing it in some of my computers (including the raspi) and it might be yet too soon since I have only been able to play with it for a week or so, but I think I am ready to tell you the truth about the zsh (heed that I mean "my truth"). And bear in mind that we, wannabe-geeks, are so enthusiast that we say "play" instead of some other more appropriate, descriptive word. In the end it is all the same: Learning and having some fun.

 

Well, when you fire up zsh for the first time it offers you a menu. You can choose among several options, it offers to create a blank .zshrc or a default basic .zshrc according to the configuration chosen by your admin (read your distro) or configure a brand new .zshrc following some other items on the menu. Man, ain't that super cool?

 

I tried all the options, and my conclusion is, if you only have a basic configuration you can only do basic things, you need to add your own aliases, your own functions and this way it (apart from some enhancements on its own) behaves very similar to other shells, say bash or ksh.

When I say "basic" I mean I even had to add things like:

alias ls='ls --color'

alias grep='grep --color'

and so on and  so forth. I even had to add alias la='ls -alh' Man, that sucks. I thought zsh  was so clever and so cool...


But what happens when you add something like oh-my-zsh ? Man, that's a completely different world!!! That is where the true power of the shell comes to the fore. oh-my-zsh and probably other similar frameworks add dozens of super elegant themes and plugins (for git, for managing history...) many of he plugins add hundreds of aliases to your configuration. 

And apart from the fact that the default theme sucks big time (which really makes you want to dive in the pool of themes looking for a better one) now I can say that zsh is really and truly awesome. Much in the same way other shells can do great things if you add them great stuff.

Themes are basically customized prompts, some of them add nice info like the timestamp of commads or simply a local clock. I like the traditional user@host (+ directory) ~$ model:

For example: chals@jean:~/bin »

Here is where one of the plugins, git, is rad. When you enter a git repo it adds the branch you are in in the prompt. 

For example:     

chals@jean:~/git » cd soma/

chals@jean:~/git/soma(master○) »

Conclusion: I am enjoying zsh a lot and I really like it. I will continue playing with it to see how many good things I learn in the long run. In my raspi it is now the default shell and by the way, I need to customize the web-search plugin for my raspi.

21 January 2022

pharc v.7.0 released


 I am proud to announce that today I released pharc v.7.0. It only includes some minor changes as you can read in the changelog:

* pharc v.7.0

* Updating permissions for gophernicus.

The thing is, when we had bucktooth as gopher server, it was ok to have permissions 750 for directories and 640 for files. This is not the case anymore with gophernicus. It needs 755 and 644 permissions.

 This is not a great deal, it was pretty easy to run these lines I found on sdf's gopher tutorial:

 

$ find ~/gopher/ -type f -print0 | xargs -0 chmod 644
$ find ~/gopher/ -type d -print0 | xargs -0 chmod 755
 

But it had to be done manually and after that you had to chmod +x your 
moles again to work. 
Like I said, this was not a huge problem but I had to do something about it. 
So now the problem seems to be fixed for good.
 
One more important change is that since I had to update the wiki for version 7. 
I added the wiki to the gopherhole. So from now on you can find both resources 
(the source code and the wiki) on the web and on gopherspace.
 
On the web:
https://gitlab.com/pharc
https://gitlab.com/pharc/pharc/-/wikis/home
 
On gopherspace:
 gopher://sdfeu.org:70/1/users/chals/downloads/software
gopher://sdfeu.org:70/0/users/chals/wiki 
 

02 April 2020

cpulimit YAIT (Yet Another Impressive Tool)

One of the truly impressive tools I discovered this week is cpulimit. It allows you to limit how much cpu percentage a process can use. It is specially indicated when running cpu intensive applications. In my case it is 'ffmpeg'.                                                                                                     
                                                                                                                                       
I use 'ffmpeg' on a daily basis to convert my .avi videos to .mp4. I often run the script at night with cron.daily but the problem arises when I need to run it during the day. Here comes cpulimit to the rescue:

 $ cpulimit -e ffmpeg -l 800 -b

Here is a quick explanation:
 -e ffmpeg (the process to limit)
 -l 800 (I have 16 cores: 800 = 50%)
 -b Run cpulimit in the background to free the terminal

Really impressive (and handy).

26 June 2018

Screenshot of the week 14

It seems we all have to use ssl in our websites from now on, therefore, I have updated chalsattack.com and blog.chalsattack.com to use https.

At the same time I had to tweak the html code a little bit as well as the the css of the site. It is not a big change, but I love how it looks like in elinks.

Note: The window manager is i3

Enjoy the screenshot of the week :)


28 May 2017

raspi 3.5 inch touch screen

I got a 3.5 inch touch screen for my raspi. Loading the driver is pretty straightforward if you use raspbian:

git clone https://github.com/goodtft/LCD-show.git
chmod -R 755 LCD-show
cd LCD-show/
sudo ./LCD35-show

Awesome!!!


07 January 2017

raspi 3 and usb hard drive

Using a 16GB sd card for a basic cli raspbian system (no desktop environment whatsoever) is more than enough. However, it is very limited to really enjoy the awesome minidlna software I installed. So I ended up attaching a 1TB usb hard drive to my raspi 3.

The first thing to notice is that the power supply works fine supporting both devices (raspi and hard drive).

The second thing is that I can now finally enjoy the UPnP service for hours and hours during these cold winter afternoons.


Note: I've been watching SG Atlantis all afternoon. What a great Saturday :)

26 November 2016

raspi 3

My raspi 2 suddenly stopped working for an $unknown_reason I only know it lost ssh connection all the time. So I decided to get a raspi 3.

It arrived on November 24th. You could have seen me broadcast on irc the steps from the moment I put my hands on it until I finally plugged it in:

Day changed to Thu, 24 Nov 2016                                                                                        
[...]                                                                                                                                            
10:03:06        @chals | My raspi3 kit just arrived yay                                                                
10:03:10        @chals | time to play                                                                                  
10:05:22        @chals | ok heat sinks in place                                                                        
10:11:49        @chals | board in case...                                                                              
10:13:53        @chals | case closed                                                                                    
10:14:01        @chals | it's show time

And here it is:

Its hostname is kiwi (legacy name from its predecesor)


(Note: Is is plugged to a 900va UPS so that it can actually work 24/7)

08 December 2015

gui vs cli

When I started using linux 10 years ago, I desperately needed graphical programs to configure the system and do most of my daily tasks, no matter how simple they were. Even though I had some basic experience typing commands at the terminal I felt clumsy when it came to surviving at the command line.

However, over the years and very little by little, I discovered that most cli programs are faster, more powerful and strikingly way easier to use than their gui counterparts.

I know this is easier said than done, but in order to prove that, I needed to make an exhaustive list of all the programs I use at the gui and their cli counterparts. Let me insist that this list is exclusively a list of software I use on a daily basis. It is far from being exhaustive in terms of covering all the software I install on my computers.

The first two examples that come to mind are synaptic and d4x. At first I always used synaptic to manage software and d4x to download files. After some time I started using aptitude and wget. I never looked back.

Then the music player. I started using cmus and I never installed rhythmbox again.

As torrent client I used several gui programs. Now I exclusively use rtorrent.

Of course the usual and most basic applications you use on a daily basis are your file manager and your text editor. On the gui I use pcmanfm and medit but on the cli I use the mc and nano.

On a daily basis you also need a window manager. I use i3 on the gui and very rarely dvtm on the cli, I tend to use tmux as a window manager instead of a proper window manager.

Perhaps the toughest program to get rid of is the web browser, we are so used to graphical browsers that it is sometimes hard to browse the web in a text only browser. I mostly use chromium on the gui and a wide variety of text browsers like elinks, which has tab support (with vp for images), lynx and lately, I have started using w3m more and more for its ability to display images inline.

I also ditched gitk in favour of tig, because it is more handy.

There is also a number of applications that I do not use on a daily basis, but almost always on the cli, such as scrot for my screenshots.

07 October 2015

torrents galore

This very week I switched to a new ISP. Having a connection of your own for the first time in your life makes a huge difference in terms of how you handle your own ports to play nicely with your software.

One of the things that I had always wanted to do was installing a torrent client which could run unattended. I have a lot of experience with mldonkey, which is a client for several networks, bittorrent among them. However, I was looking for a lighter client for my raspberry pi. I tried several clients: rtorrent, ctorrent, and I finally settled for transmission, or more accurately transmission-cli.

Many, or most clients, have both a GUI and a CLI, some of them have a web interface which is great for managing your downloads from a remote location. But I somehow prefer logging into the machine using ssh, opening a multiplexer instance (usually screen) and fire up the bittorrent client. This is damn simple for all of us who spend most of our free time logged into remote machines, for work or play.

Using transmission-cli is easy peasy:

 $ transmission cli *.torrent

Awesome!!!

Update 11-10-2015: A friend of mine suggested trying transmission-daemon and its web interface. I did. It is great,  even though it needs a little tweaking since it uses a different user by default (debian-transmission) and you have to give that user write permissions to the directory you want to store your files.

Update 24-11-2015:  Even though I use transmission-daemon and transmission-cli on my raspi. I exclusively use rtorrent in my laptops and servers. rtorrent is a really powerful and handy bittorrent client.

23 December 2013

Screenshot of the week 7

A few days ago I wrote a tutorial on how to configure weechat's relay plugin through a single port for all servers. I published it on my phlog, so I'm not unnecessarily going to repeat the information here. The link is here in case you are interested: (Warning: gopher link!)
gopher://sdf-eu.org:70/1/users/chals/phlog/2013/./12-15-13
Since the relay is working so fine, I decided to take a screenshot of the weechat instance running 24/7 with the configured relay running in a remote server and the other one of my local instance running in my raspi.
Just in case somebody is wondering why I run two instances of the same program both locally and remotely, the answer is plain simple. In my local instance I can configure and use as many plugins and scripts as I like whereas things are not so easy on the remote server. For example the aspell plugin which is really handy when typing fast or the buffersscript, just to name a few.


06 December 2013

weechat2

It has been a really, really long time since I used weechat for the last time but now I'm back and I don't anticipate to look back again.
My first irc attempt was with a web-based client (possibly mibbit) Then, when I started irc'ing seriously I started using irssi (inside screen). After that, a friend of mine recommended me weechat (inside tmux). I liked both combinations, but I soon went back to the good old duo irssi and screen. Why? Well, I really made an intensive use of the irssi proxy plugin. With it I could connect to the same core from different clients and different locations. It was very handy for me. (I know that weechat also has a relay plugin but I never bothered configuring it)
Now I really do not use the proxy. I only use one computer at a time so connecting via sshto the machine running my irc client 24/7 is more than enough for me at the moment. But then, the bad news, the machine running my irc client (odin at sdfeu.org) crashed and we were left without the service for an unspecified amount of time.
So I put plan B into practice. Bounce using my raspi, which already hosts my gopher server. In my raspi I only had tmux and weechat already configured, so I didn't spend any time installing and configuring other programs. I directly launched the already existing ones. And wow! what a difference. Now that I'm a bit more into the irc world. I can take advantage of the plugins and scripts that allow you to achieve what you want/need.
One big difference between weechat and irssi is that weechat's scripts and plugins seem to be more integrated (ie. work better) than in irssi. Apart from the fact that weechat has a lot of default options that you can only achieve in irssi installing plugins.
The best plugin, so far, is the aspell one. Once activated, it highlights in red your misspelt words. This way you avoid posting a lot of typos.
The best scripts, so far, are: the buffers.pl, urlbar.py, urlgrab.py, cmus.py, weeget.py, iset.pl and isgd.pl (a url shortening service utility) but there are also a lot of fun and interesting ones, like for example , the games weetris.pl or mastermind.pl. Some other scripts that allow you to manipulate text are, among many others, leet.py, upside_down.py or prism.py
I have played with some others and I will spend the rest of the weekend trying new ones, like for example the beep.pl or launcher.pl ones.

22 April 2013

Scrobbling to libre.fm as seen by elinks


In my .bashrc you can find (among many others):
 # Export browser && homepage

 export BROWSER="elinks"
 export WWW_HOME="http://chalsattack.com"
Elinks is the heck of a console browser for many reasons: It is a full featured browser with few limitations, it has mouse support for following links and scrolling up and down and it has tabs like so many other graphical counterparts. And the best thing of it all is that it is so easy to use them that once you get used to them you just cannot do without.
t opens a new tab.
<> move between tabs.
c closes tabs.
Ctrl + r reloads a tab/page.
Nevertheless I must admit that I also use w3m on the tty if I need to see the pics andlynx for browsing gopherspace. One curious thing is that elinks does not support the gopher protocol out of the box. You have to compile it with gopher support in case you want to take advantage of it, but if you type a gopher url in elinks it automatically opens a lynx instance to display the gopher hole. Awesome :)
In this screenshot you can see my libre.fm page while I'm scrobbling with cmus as seen by elinks.


17 April 2013

cmus

Throughout my relatively short (or long, it's hard to tell) experience with gnu/linux systems I have used a variety of console music players. If I remember correctly the first one I used, years ago, was music123, then mocmplayer...I had recently settled with nvlc because I found it very handy to start it on an ssh/tmux session to be able to control it from any corner of my network. See post on nvlc for details.
But now I have definitely and absolutely switched to cmus the single best console music player I know so far. Why?
Well, to begin with, I can still use it inside tmux or screen and use ssh to control it over the local network.



Secondly I can scrobble with it to http://libre.fm so that the songs I listen to are immediately published online.



cmus does not scrobble out of the box by itself. In order to make it scrobble I downloaded a script named last-cmus.py (linked from cmus official site) and modified it a bit. The process is pretty simple. Download the script to $HOME/.cmus, make it executable, edit username, password and url to use "http://turtle.libre.fm/". Finally, in cmus interface set status_display_program=/home/chals/.cmus/last-cmus.py


And last but not least. I can know which song I'm listening to at any time since it is echoed by conky.



Again, cmus does not directly communicate with conky. I had to download another script I found on the internet to make it work. Then I edited my .conkyrc adding this:
 ${color #ffcb48}Now Playing ${hr 1}

 ${color lightgrey}
 ${execi 2 /home/chals/Dropbox/bin/cmux-conky}
Notice that this time in order to make this setting more portable inside my own network, I added the script to my Dropbox folder so that I can access it from all my machines.


Awesome, huh!

28 December 2012

raspi at work



I must admit that I am really, really excited about my raspi (raspberry pi). I ordered it three months ago and during all this time I have spent a lot of time thinking about the endless possibilities that such an amazing piece of machinery could offer.
I have installed a lot of applications from the debian archive, perhaps the most outstanding ones are the servers: ssh, ftp, http and gopher.
In the screenshot you can see the result of:
 $ lynx gopher://localhost
and the moment of writing this post.


24 November 2012

Screenshot of the week 3

A beautiful screenshot of mrxvt with transparency over X11 forwarding through ssh with two open tabs: mc and tmux



09 August 2012

debootstrap


If you have ever used a unix/linux system you probably know about the chroot command. I have several testing chroot directories in my debian systems but I had never really taken advantage of such a great tool as debootstrap is, at least consciously.

This week I installed sid in a chroot in wheezy and I'm really enjoying the fact that I can play with it as much as I need to without risking breaking things badly.

I heard (on the net) that lxc are even better. I quote:

  described as “chroot on steroids”


I once tried installing a container in wheezy but I didn't succeed, I'll try again at the weekend.

26 March 2012

Syntax highlight: nano vs. vim

Syntax highlight is of course configurable so that you can use the colours you prefer or like the most. In both nano and vim you have to activate it, otherwise you do not have syntax highlight straight away like you have in other editors such as gedit.

It is not my intention right now to explain how syntax highlight is activated in any of those text editors. I'm just publishing here a screenshot that shows why working with colours enabled is better. On the GUI I always use gedit. On the CLI I use both vim and nano but I think that nano is both easier to use and nicer. This is the syntax highlight I get for po files. I definitely prefer nano's colours.

This will be the screenshot of the week.