Saturday, 19 March 2022

Updated transmission image

 Simple base image update to alpine 3.15.1, no other changes.

Monday, 28 February 2022

flexget and finance-quote

My recent patch fixing a crash (undefined var) on anilist plugin of flexget when yuna.moe is unreachable has been merged. It's included on flexget 3.3.1 and on my docker image grmontesino/flexget:3.3.1-i1

In similar news, the Tesouro Direto finance-quote module I've submited to finance-quote also have been merged and should be available on finance-quote 1.52 release planned to mid-year.

Saturday, 19 February 2022

WSL tricks part 2: VPN and MTU Setting

The first time you try to ssh to a remote server from WSL over a VPN connection, there's a good chance the connection will hang as soon as you start using it. After a little testing you may notice that it happens when using any command with longer output.

It turns out that the interface for the HyperV VM used to run wsl2 doesn't set its MTU correctly, and the network packets get discarded somewhere along the way. To fix this (assuming we don't have control over the VPN configurations) we need to set the MTU manually.

To find out what MTU setting should be used, the "tracepath" command can be used. Just install the package if needed, run "tracepath <server reachable by VPN>" and check the lowest "pmtu" value shown, that should be set as interface MTU.

For the configuration itself, a quick search on the internet did wield a few alternatives, but the nicer ones unfortunately didn't work... Setting the MTU directly on the HyperV configuration didn't get persisted across reboots; WSL's ubuntu doesn't seem to read any interface configuration on startup by default (and I don't see any good reason to install a init system on WSL)... 

In the end I've resigned myself and adopted the ugly solution: put the command to set it directly on ~/.bashrc:

#MTU
sudo ip link set eth0 mtu 1350

To get it at least a little less ugly, we can make it so sudo doesn't ask for a password: run "sudo visudo -f /etc/sudoers.d/mtu" and create the file with the following content:

ALL    ALL = (root) NOPASSWD: /sbin/ip link set eth0 mtu 1350

That will fix the hanging SSH problem. It's ugly because the MTU should be set dynamically / automatically and It's ugly because bashrc isn't the proper place for this kind of configuration, but at least it works.

Sunday, 13 February 2022

Docker Image: BURP BackUp and Restore Program

Just released my images for burp on github. This is a somewhat more complex stack with 4 images - base, server, client and web user interface - and a bit more of scripting on the entrypoints to support the configuration file schema used by burp.

With 4 images in one repository and a dependency relation on the base for the other three, I wasn't sure how it would be to build everything automatically through github actions, but it turned out to be pretty easy. Just build base first, the other three after in parallel. 

Github actions matrix strategy option for running similar jobs with a few parameters changes with no need to make various almost identical copies of the definition and/or having to make some more complex reusable job configuration turned out to be very handy.

Saturday, 12 February 2022

WSL tricks part 1: Windows' openssh key handling

For a long time I've been using a very simple setup on Windows to manage Linux servers: just plain old putty, pageant, winscp and the like. With the recent implementation and advances on WSL, I felt it was time to test using WSL to have a better environment, and it has been a very good experience so far.

As this setup required a few tinkering around to get everything into place, I'll be writing up a few of the thoughts and tricks I've gathered along the way. For start, let's talk a little about something which caught me by surprise: the native Windows' OpenSSH ssh-agent key handling.

The first piece of our small puzzle to make a Windows station a good administration platform for Linux servers is to have ssh connection to those servers. Windows terminal is a good start, being a tabbed multi-terminal with support for cmd, powershell and WSL.

After that, it was a very interesting to discover there's a native port of OpenSSH for Windows available. At first sight, this could be an interesting tool to get this level of access without even needing to use WSL. But there's a catch...

To use ssh, you'll be willing to load your ssh key over an agent so you don't have to type your super-secret-long-passphrase every time, having it work automagically during your work session. The concept around ssh-agent is that your decryptographed key will stay in memory, never touching disk / permanent storage, and as such will be securely erased when you unload it and/or power down (assuming no one is going to do some crazy ninja cold RAM data extraction to get your ssh-key).

By the other hand, Windows' openssh port just disregarded the whole concept and instead permanently store your ssh key on Windows Registry, which in turn get persisted on disk itself. While it seems to be cryptographed over some kind of user-context security, it didn't really strike me as particularly safe, and there's some article somewhere explaining how it could be recovered by someone with access and how it would be very hard to get it fully out of disk once it gets there.

While I didn't dig much deeper in this, what I saw was enough to convince me to stay away from windows' openssh - there certainly seems to be some risk, and wsl + ubuntu ssh works perfectly fine for my needs. 

Wednesday, 9 February 2022

finance-quote development and Tesouro Direto

Recently sent a pull request for the inclusion of the Tesouro Direto module on finance-quote, which is the library used by gnucash for "commodities" quotes. If that goes well I might be sending one or two more modules I've made (or want to make) and use (or want to use).

Also published a simple development environment container with the fq's dependencies pre-installed - pretty nice way of developing and testing things without installing lots of dependencies directly and risking messing the "stable" version in "production" use.


Monday, 7 February 2022

docker-flexget 3.2.18-i1

Released docker-flexget 3.2.18-i1 yesterday. 

Simple update to keep up with upstream (which already includes my smallish patch to fix some problems introduced to anilist client on 3.2.5).

Saturday, 5 February 2022

Incremental pvmove

I've recently had some fun with a BTRFS filesystem corruption (described in a gist here). Ended up with the recovered data in a linear LV formed by 2 non-redundant PVs.

After all needed checks were done and a fresh backup taken, it was time to eliminate the failed btrfs filesystem and get the data back on redundancy by reusing its RAID5 array. In my mind, it would be simple a question of pvmove'ing the data, which I could do over time, no hush, by making partial/incremental data moves.

Contrary to what I expected however, it turned out I couldn't just run pvmove for some time, cancel it and have the data which was already moved stay on the new volume; instead, after stopping pvmove the lvm structure stayed as it was at the start.

It turns out pvmove basis for data movement is the segment, that is, contiguous allocations of data, not individual extents as I expected. For the data movement to be "commited" it would have to finish moving the whole segment, which in this case would mean moving the entire PV / disk partition, as it's fully allocated to the same LV.

As pvmove also supports specifying specific areas of the PV to move, It seemed right to script my way to the result I wanted, so I've made a small script to sequentially pvmove a disk in "small" [parameterized] amount of extents per time. The script can be interrupted and the fully finished pvmove's stay as they should, so you can get back another time and continue from (mostly) where you stopped.

Please keep in mind that this has been made and tested in a very specific case - PV allocated sequentially to a single LV. I didn't really try to cover other user cases, so it could move data it shouldn't, and while I don't expect a pvmove to cause data loss, if the script somehow gets the start extent or size wrong, I can see it getting the LV / filesystem fragmented. As usual, having a backup ready is recommended.

Without further ado, my hackish incrementa_pvmove.sh script is available here: 

https://gist.github.com/grmontesino/8ec29cd16cf3d893dde808f35f079304

Thursday, 3 February 2022

Yuube - last night / evening

After some time around non-native languages, something which you'll notice is that they've what seem like "traps" designed to make confusion and/or cause miscommunications. 

I guess our native languages do have these traps too, but being used to them we don't even notice - in the end of the day, on real world usage the right meaning ends up being clear for context (or we just miscommunicate anyway and life follows).

Today's trap from my morning Japanese goes to "yuube" - the same word (or two words with the same pronunciation?) has two meanings dangerously close but different to each other:

昨夜 last night

夕べ     evening

https://jisho.org/word/%E5%A4%95%E3%81%B9

Wednesday, 2 February 2022

Docker images: Transmission and Flexget

 Hello,

Just a quick note that I've published (after some cleanup and improvements) the docker images I use for transmission (bittorrent client) and flexget (media management automation). The "source" for the images, along with documentation and suggested docker-compose files, are available at github:

As a fun learning project, github actions have been configured to automatically build the respective images and automatically push then to Docker Hub:

While those are simple images perfect for some testing, I expect to publish some of the more complex stuff I use in the future.

Saturday, 29 January 2022

I am back (?)

Just found out this blog still exists and had some fun reading the posts from 10+ years ago... Some things changed so much, others are still exactly the same...

Maybe I can find some inspiration to make some more brain dumps around and document a bit of what I've been doing lately; who knows...

Wednesday, 18 February 2009

Book: Blood and Gold

Blood and Gold is yet another book in Anne Rice's Vampire Chronicles. There, an old vampire named Thorne wakes from his long sleep and is greeted by Marius, which tells his history: how he was transformed in a vampire, got the mission to protect the first vampires, his life in various places and ages, his loves, allies and enemies, etc.

It did take some time for me to get immersed in this book. In the beginning, it seemed kind of slow/boring. However, as Marius history advances, some more interesting things start to happen, and by the middle of the book it starts to have the "what will happen next? guess I'll read just one more page" effect.

As with Mennoch the Devil, I believe the earlier titles of the series are more interesting. If you've read them and like Rice's works, then this one might be a very interesting reading.

PS: Big thanks for the friend which lent me the book

Sunday, 15 February 2009

Travel: Campos do Jordão

I've been to Campos do Jordão, a well-know tourist city, to pass a small honeymoon (my weeding was at Nov 21st last year, which explains in part the lack of posts on this blog for some months :P). Some quick pointers about the city:

1. The Way

From Sao Paulo, take the Ayrton Senna Highway until the end (or the Dutra as an alternative). Follow the signalization and you'll end up on SP-123, which goes until the city's beautiful portal.

The Ayrton Senna is a nice highway managed by the private sector. It's a large and well taken care of, which IMHO pays for the (somewhat expansive) toll road. Nevermind the fact I managed to have my windshield hit by an ~ 10cm wood plate that came from nowhere; somehow it got unscratched. Also it isn't any news, but some people don't drive as one should in a highway there.

SP-123, by the other hand, is your typical government-managed road. One lane, few passing points, highly irregular paving. It goes up on the Serra da Mantiqueira, so it's also full of dangerous curves and can have fog. Drive carefully around there, respect the speed limits (specially if you don't know the region) and be aware of idiots.

2. The City

  • The architecture is beautiful
  • Cold, rainy climate. This can be really bad if you stay there only a few days, as the rain can keep you from doing some of the interesting things
  • The city has a main avenue with two small centers (comercial and touristic). Outside these centers the streets are mostly not paved and usually irregular.

3. Accomodations

There are a lot of places to stay (most, if not all of them, on the expansive side of the scale. It's a tourism-heavy city after all...). We've stayed in a place called Uma ilha na montanha (An island in the mountain). It's an interesting, nice and quiet place if you don't mind staying away from the city's center, in a pretty remote location accessible only by scary non-paved roads which aren't on google maps (yet).

4. Some interesting places and stuff to do

  • Train trips to nearby cities, passing through the beautiful landscape views on the Serra da Mantiqueira.
  • Lots of places to buy small souvenirs (I recommend the chocolate-flavored beverages).
  • Foundue rodizio (fixed price, each as much as you want foundue). It was my first time eating foundue, and I've liked it a lot. Restaurant Krokodilla, at Av. Senador Roberto Simonsem, 1350, Capivari. Just follow the signals for the Ducha de Prata (something like silver shower)
  • A cool Japanese restaurant (I just have to find one of these everywhere I go): Restaurant Kouguem, at Trav. Isola Orsi, 47, Capivari, near the train and tramway stations.
  • A well-known aerial tramway on which I unfortunately was unable to ride, thanks to the rain.

More Info

Thursday, 12 February 2009

Friday 13th; Unix Time: 1234567890

Tomorrow will be Friday 13th. To make this the coolest friday 13th ever, at 23:31:30 UTC (in São Paulo daylight savings time that would be 21:31:30), Unix Time1 will be "1234567890". Cool, isn't it ^_^

Thanks to that, I've seen what might be the coolest programing joke I've ever seen on the slashdot history comments:

Every day is a long day, because 86400 seconds won't fit in a short."2 — FooAtWFU,

1: Unix systems keep the time by storing the amount of seconds which elapsed since midnight of January 1st, 1970.

2: a (unsigned) short in programming is a variable which can keep a value from 0 to 65525 (aka 216-1).

Tuesday, 10 February 2009

Manga: Bleach 19 with colored pages!

I've had a pleasant surprise yesterday: The people at Panini have included some colored pages in Bleach 19. AFAIK1, this was the first manga released on Brazil with colored pages. thumbs up ^_^

BTW2, It's interesting how Panini has been releasing good mangas lately... To think not so long ago JBC was the best manga publisher around there... They have lost themselves somewhere, I hope they can recover.

Edit: As nee-chan pointed out, indeed Chobbits had colored pages before Bleach


1: AFAIK = As Far As I Know
2: BTW = By The Way

Thursday, 6 November 2008

Stuff to keep in mind (part 1?)

Internet Argument It's easier to be an asshole to words than to people Courtesy of xkcd (#438)

Monday, 8 September 2008

HP Laserjet P3005d

We have acquired a new HP Laserjet P3005d printer at work some months ago, to replace an aging HP laserjet 2300dn which was consistently jamming on duplex jobs. The new printer just doesn't feel as good as the older one though... Anyway, there are some notes about problems I've found with it for reference.

CUPS, driver and advanced options/booklet printing

The printer was conected by USB to a Debian GNU/Linux server. With the 2300, running the setup allowed one to choose "client setup", tell the URI of the printer and have it just work out of the box with all the resources enabled. Unfortunately, this option isn't available in the 3005 driver (maybe HP people want to sell more network modules for the printers?).

To work around this issue while getting advanced options, such as booklet, working, one needs to install the printer as if it was connected on the computer, and create a new "local port" with the printer samba URI as "name" when asked about the printer port. (If such advanced options aren't needed, following the steps on the samba howto to install the printer driver on the server works well).

Strange printing anomalies after changing the toner

After replacing the toner with a new one, there was some horizontal bars and strange bubble-like stains on the printings. Took some time to figure out that the basic mandate of the computing would solve this one: just turn the printer off, give it some small time and turn it back on.

Sunday, 17 August 2008

How to NOT make a web form

The 2009 trainee's program of the multinational Unilever are open. As I've graduated recently, and heard some people say very good things about employment there, I've decided to apply myself.

With that in mind, I've followed the links on the Unilever page to the register myself. This brought me to an interesting web-based form, apparently designed by Cia de Talentos, an recruitment agency around there: Instead of using standard html selection boxes (ie, select elements), they just got creative and decided to reinvent the well using input elements and some "nice" down arrow images, on which you can click to get a "lovely" popup on which you can select you choice, which then gets dutifully copyed back to the input. Of course, they also set the choice's code on an hidden input element, presumably to easy their parsing later... Oh, and some of them even have the proper code, using select element, commented above them (for easing of legibility, I suppose...)

Now that I've let everyone anxious to see such beautiful art of the web programming, I'll let you see a snippets of the code:

<input type="text" name="Text_CodPais_cand" size="30" value="" onFocus="SetSav('SavRegioes'); SetSav('SavCand'); mudaFoco('Nome_cand',-1)" style="color: #0000FF; background-color: #EEEEEE; font-size: 8pt; font-family: verdana; width: 260px"> <img src="img/SetaCombo.gif" align="absmiddle" onClick="SetSav('SavRegioes');SetSav('SavCand');setCmb('un país', 'CodPais_cand',-1,280,260,0,'Nome_cand',-1)"> <input type="hidden" type="text" name="CodPais_cand" value="31">

I haven't really parsed all of their javascript (it's long, messy...), but it seems to make some "clever" stuff like create the full html of the popup using document.write.

They also seem unable to keep track of your language around the multipage form, so I also had to guess some Spanish stuff to be able to fill it fully (and got wondering in what language I should fill some fields also... settled on keeping everything in Portuguese.

To make this long history short, the main lessons I would take from this on the top of my head:

  • Never ever make a fake select by using input and img. If you think it's the solution to your problem You're doing it wrong. Trust me, You'll look foolish, and some moron (or not) with so much time (or not) will make sure to tell the whole, lazy web on his blog.
  • Keep the language of your web pages consistent.
  • Be careful if you're going to outsource something. Some times people might notice it wasn't you which has done the foolish thing, some times not. Independently, they might chose to do business with you, or might think you aren't worth it if you can't even get a simple webpage done right. Either way it will damage your image if someone does something so messed up in your name.

Just for the record, in this case in particular I've chosen to register myself anyway; as I've got some really good references about Unilever. But I'm worried if this is the competence to be expected from their IT sector (which is also the sector I would work) - even if this wasn't their doing, there should be someone watching the quality of their outsourced work...

Wednesday, 30 July 2008

College Finished ^_^

I've finally graduated from college course recently (something like a month ago, actually). I've made a four year technological graduation course on Data Processing at the São Paulo campus of FATEC, a somewhat renowned public college around there.

The course itself is, as the name (which was recently changed) suggests, a bit outdated. It's purpose is to teach IT with focus on how it's used on the real, work life, and is partially successful at th at, even though an update to more modern technologies (such as better coverage of OOP practices in place of the over-emphasized structured analysis) would be good. As with every graduation course, it shows the tip of the iceberg, and the students need to learn the rest by themselves. No news on the teachers side also: a few very good teachers, some average ones and some really bad ones, besides a few which are so bad that calling them teachers should be a crime.

The strongest point about FATEC, and the reason that its name stay high even though the course itself isn't anything above what I believe to be the average is, in my opinion (and of some others I've talked about it) the students themselves. The high competition on the entrance exams, plus the hard classes of math right at the start of the course, makes sure that only people intelligent enough to handle themselves and learn whatever they need (plus a few flukes, of course) graduate.

Friday, 20 June 2008

Accident at the Barra Funda Metro Station

About two hours ago, there was an accident in São Paulo's Barra Funda Metro Station. I can't say I really know what happened, but it seems that an user (a women apparently) fell on the rails and was run by an incoming metro (or got some body part stuck between the platform and the incoming, most likely moving, train). Either way, by the actions of the metro agents, I would guess the victim has died from the accident (they where trying to make the rescue operations fast, and them clearly got stopped with the hurry, as if there wasn't anything that could be done anymore). Considering that the services where restored fast, without time to any kind of forensics, I would guess the victim's body wasn't too much lacerated; but all this are just speculation as I didn't see (nor wanted to) the accident scene.

I have seen some interesting things about the operations, though:

  • They seem to call this kind of accident of code A
  • All the medical stuff was behind a locked door. It took some time (at least one minute and a half) to one agent get there with the key, while there where already other agents waiting
  • Worst of all, one of security agents hit an user which tried to take a photo (or more specifically, the user's camera). Even if taking a photo in such circumstances might be of debatable taste, this reaction seems completely unacceptable in a free, democratic country which should mean people has press liberties to report whatever happens.
  • No news outlet seems to report this kind of accident; everything seems to be done in order to keep those hidden. This might support some theories I've heard that these are frequent.