Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre python (publicaciones antiguas, página 104)

Learning Serverless in GCP

Usu­al­ly, when I want to learn how to use a tool, the thing that works best for me is to try to build some­thing us­ing it. Watch­ing some­one build some­thing in­stead is the sec­ond best thing.

So, join me while I build a lit­tle thing us­ing "server­less" Google Cloud Plat­for­m, Python and some oth­er bits and pieces.

Caveat: this was orig­i­nal­ly a twit­ter thread, so there will be ty­pos and things. Sor­ry! Al­so it's pos­si­ble that it will look bet­ter here in thread­er­app

Leer más…

Airflow By Example

Apache Air­flow is a very in­ter­est­ing, pop­u­lar and free tool to cre­ate, man­age and mon­i­tor work­flows, for ex­am­ple if you want to do ETL (Ex­tract / Trans­form / Load) on da­ta.

This sort of en­ter­prise soft­ware of­ten may seem com­pli­cat­ed or over­ly un­re­lat­ed to our ev­ery­day ex­pe­ri­ence as de­vel­op­ers but ... is it, re­al­ly? How about if I just want to watch some TV shows? And ex­per­i­ment with some en­ter­prise-lev­el soft­ware at the same time?

Let's do that by learn­ing how to use Air­flow to watch TV.

Caveat: This post was orig­i­nal­ly a twit­ter thread, that's why all the ex­am­ples are im­ages and you can't copy­/­paste them. But hey, at least they are short. Al­so, ty­pos, be­cause I re­al­ly just did this while tweet­ing it, no prepa­ra­tion be­fore­hand.

Just in case: I did not down­load any "S­tar Trek: Pi­card" es­pisodes, and I have a Prime video sub­scrip­tion, so I don't need to down­load them via tor­ren­t. OTO­H, if Sir Patrick ev­er reads this (which he won't): good job, sir!

Leer más…

Looking for a new job!

My cur­rent em­ploy­er (not any­more!) and I have de­cid­ed to part ways. So, I am now open to new ad­ven­tures in Python-­land.

I am lo­cat­ed near Buenos Aires, so re­mote po­si­tions much pre­ferred, lo­cal Buenos Aires ones could work too if it's the right one.

I have a ton of Python ex­pe­ri­ence, lots of en­gi­neer­ing man­age­ment ex­pe­ri­ence and I am look­ing for­ward to learn­ing new stuff and try new things, so let´s make this an op­por­tu­ni­ty!

My re­sume is here: http­s://­doc­­BrIey

XRandRoll: a new program to configure displays

TL; DR: I wrote a ex­per­i­men­tal tool to sup­port X dis­play con­fig­u­ra­tions which I think is, or at least will be, bet­ter than oth­er­s, and you can check it out at http­s://github.­com/ralsi­na/xran­droll

Now the re­al post:

I have been us­ing a du­al mon­i­tor con­fig­u­ra­tion for a lit­tle while. How­ev­er it's a slight­ly spe­cial one.

  • One mon­i­­tor is a nor­­mal sam­­sung 27" 1080P mon­i­­tor. But it's in a mon­i­­tor stand that al­lows it to ro­­tate. So it's ei­ther hor­i­­zon­­tal or ver­ti­­cal.

  • The oth­­er mon­i­­tor is the lap­­top's. BUT ... it's a 2-in-1 so it can be in "nor­­mal" or "ten­t" or "tablet" po­si­­tion­s. And when it changes po­si­­tion it re­­con­­fig­ures it­­self au­­to­­mat­i­­cal­­ly us­ing KDE's awe­­some sup­­port for it. So it can be in 4 dif­fer­­ent ori­en­­ta­­tion­s.

So, if you are count­ing, that gives me 8 dif­fer­ent pos­si­ble mon­i­tor con­fig­u­ra­tions.

Al­so, an­oth­er thing is that while both screens have the same res­o­lu­tion, they have very dif­fer­ent phys­i­cal di­men­sion­s. Dis­play con­fig­u­ra­tion tools usu­al­ly don't care for that (maybe with good rea­son!)

So, I want­ed to ex­per­i­ment with how a tool would work that:

  • Looked / worked more or less like cur­rent tools

  • Al­lowed a lit­­tle more flex­i­­bil­i­­ty

  • Did some fan­­cy scale things with phys­i­­cal di­­men­­sions

  • Tried to sup­­port xran­­dr fea­­tures that are ig­nored by most tools

  • Got its con­­fig­u­ra­­tion from xran­­dr it­­self.

  • Ap­­plied its con­­fig­u­ra­­tion via xran­­dr

  • Did screen mir­ror­ing bet­ter (say: ex­act mir­ror­ing when mon­i­­tors are not the same mod­­e? It does that)

So, xran­droll starts with sev­er­al "philo­soph­i­cal" opin­ions in place.

In prin­ci­ple, it stores no con­fig­u­ra­tion. It should ob­tain the state from xran­dr. So it starts with a re­al re­flec­tion of your sys­tem as it ex­ist­s.

It al­lows more dis­play scal­ing flex­i­bil­i­ty. In­de­pen­dent scales per ax­is! A wid­get that does all the sil­ly cal­cu­la­tions to make things the same size!

It sort of does what I want now? In a pro­to­type­y-this-­code-need­s-­to-be-rewrit­ten way?

For the fu­ture, I in­tend to add ca­pa­bil­i­ty to mon­i­tor your mon­i­tors (he­h) and re­fresh it­self if, for ex­am­ple, you plug in a mon­i­tor to your com­put­er with xran­droll run­ning. Al­so, some sort of ser­vice that con­fig­ures mon­i­tors au­to­mat­i­cal­ly as they are added / re­moved.

So, it may be worth tak­ing a look at it. If you find bugs (there are bound to be dozen­s) you can file a bug at­tach­ing your xran­dr out­put and I can de­bug them!

In­ter­ac­tion, UX, etc are still a WIP and sub­ject to change. Ex­per­i­ments are be­ing made. But it should be un­able to de­stroy your sys­tem! You can prob­a­bly even go back to what­ev­er work­ing con­fig you had by click­ing "Re­set"!

Have fun and keep me post­ed.

Contents © 2000-2024 Roberto Alsina