A Planet Express Delivery

Reader

Read the latest posts from A Planet Express Delivery.

from dbalan's journal

NixOS and Nix are revolutionizing linux distro space: providing a single programing environment that controls everything from building your kernel, ensuring your containers run to getting SSL cert from letsencrypt (it comes batteries included, you don't have to build the kernel if you don't want to).

There exists a mutitude of tooling to remotely manage nixos machines, each with its own features and compromises. However you can also just use a simple flake with nixos-rebuild --target-host.

This is the workflow I've been using to manage my systems.

I bootstrap the machines manually by following the nixos install guide, and copy over the generated configuration to config/<hostname>/configuration.nix.

On the root directory create flake.nix:

{
  description = "systems needed";
  inputs = {
     # extra inputs go here
  };

  outputs = { self, nixpkgs }@attrs: {
    # this is where we add new machines
    nixosConfigurations = {
     # host nixmachine
      nixmachine = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = attrs;
        modules = [
          # This points to the actual machine configuration
          (import ./config/nixmachine/configuration.nix)
        ];
      };
    };
  };
}

This can be deployed by

nixos-rebuild switch  --target-host root@<hostname> --flake '.#nixmachine'

A new host can be added by adding a new entry inside nixosConfigurations.

Should I do this?

I think this is an easier workflow for me to manage and debug, However a lot of things in this space has non-linear learning curves and has sparse documentation at best.

So maybe a tool with better documentation might work well for you?

This also relies heavily on flakes, which is “experimental”. In my experience, this translate to everyone uses flakes, but good documenation is hard to come by (I've herd good things about https://nixos-and-flakes.thiscute.world/, but haven't read it)

Comments?

Hit me up @nomycommit

 
Read more...

from dbalan's journal

While FreeBSD mastodon package was great, it also broke our server!

When we ran pkg upgrade, the ruby version got bumped. But mastodon needs a specific ruby version to run, and there goes the server.

Thankfully it was easy to restore.

  1. Nuke the pkg and grab the code from git

  2. Install the correct ruby version with rbenv

    rbenv install 3.0.6
    
  3. setup mastodon again (better check the project readme) with bunch of bundle exec incantations.

  4. The side effect of loosing packages was that we also don't have service files anymore. While there were plenty of examples and help, we eventually ran it with supervisor with config, which is far simpler than service files IMO.

    • mastodon-web
[program:mastodon_web]
command=/usr/local/www/mastodon/.rbenv/shims/bundle exec puma -C config/puma.rb ; the program (relative uses PATH, can take args)
directory=/usr/local/www/mastodon/live                ; directory to cwd to before exec (def no cwd)
autostart=true                ; start at supervisord start (default: true)
autorestart=true              ; retstart at unexpected quit (default: true)
startsecs=10                  ; number of secs prog must stay running (def. 1)
startretries=3                ; max # of serial start failures (default 3)
user=mastodon                   ; setuid to this UNIX account to run the program
redirect_stderr=true          ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/mastodon/web.log        ; stdout log path, NONE for none; default AUTO
environment=RAILS_ENV=production,PATH=/usr/local/www/mastodon/.rbenv/shims:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
  • sidekiq
[program:mastodon_sidekiq]
command=/usr/local/www/mastodon/.rbenv/shims/bundle exec sidekiq -c 25 ; the program (relative uses PATH, can take args)
directory=/usr/local/www/mastodon/live                ; directory to cwd to before exec (def no cwd)
autostart=true                ; start at supervisord start (default: true)
autorestart=true              ; retstart at unexpected quit (default: true)
startsecs=10                  ; number of secs prog must stay running (def. 1)
startretries=3                ; max # of serial start failures (default 3)
user=mastodon                   ; setuid to this UNIX account to run the program
redirect_stderr=true          ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/mastodon/sidekiq.log        ; stdout log path, NONE for none; default AUTO
environment=RAILS_ENV=production,PATH=/usr/local/www/mastodon/.rbenv/shims:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
  • mastodon streaming
[program:mastodon_streaming]
command=/usr/local/bin/node ./streaming ; the program (relative uses PATH, can take args)
directory=/usr/local/www/mastodon/live                ; directory to cwd to before exec (def no cwd)
autostart=true                ; start at supervisord start (default: true)
autorestart=true              ; retstart at unexpected quit (default: true)
startsecs=10                  ; number of secs prog must stay running (def. 1)
startretries=3                ; max # of serial start failures (default 3)
user=mastodon                   ; setuid to this UNIX account to run the program
redirect_stderr=true          ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/mastodon/streaming.log        ; stdout log path, NONE for none; default AUTO
environment=NODE_ENV=production,PATH=/usr/local/www/mastodon/.rbenv/shims:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin

Its all very janky and defintily a hotfix but it works for now. Maybe one of these days we will migrate to nomad.

 
Read more...

from shox

For that elusive bit of time

The last four lines from Kipling's If sum up the human predicament quite well.

Sixty seconds. A minute. How do you fill this minute with value? What is valuable to you now? Will it be valuable to you later, or to those who will carry on your flame?

The countdown timer is above our heads, recording 60 seconds with every minute. It is a very hard thing, to keep the unforgiving minute filled.

If you can fill the unforgiving minute With sixty seconds’ worth of distance run, Yours is the Earth and everything that’s in it, And—which is more—you’ll be a Man, my son!

 
Read more...

from jiyometry

While the biological epidemic is doing it's job, there is another epidemic that spreads among the population. This one is silent, unacknowledged, and unaccounted for until it is too late. It is not fatal, at least mortally, but has impact on several aspects of our lives. This epidemic is the epidemic of fears, epidemic of explanations and epidemic of actions. Strong Phillip provides different types of psycho-social epidemics.

Epidemic of fear is exactly what is understood by the reader. People of the pandemic are afraid of this unseen contagion. They are afraid and also suspicious about the next person standing in the line for groceries. This epidemic of fear is bipolar based on the human rationality and sentiment. Either people are overly afraid of the contagion, surfaces it might be contaminating, and the reality that is created, thus being in a panic state or are totally callous about the reality, the surfaces, and the contagion. This swaying happens until something grave happens around them. This 'something grave' results an epidemic of explanations.

The epidemic of explanations is witnessed through an outburst of theories, speculations, hypothesis, and so forth; all related to the survival during the pandemic. Many of such outbursts are moral in nature: Why did God create this virus? Will society survive this? Who in this society will survive the pandemic? and so forth. While these speculations act as a force to keep people inside their homes, it also keeps creates an epidemic of actions or potential actions.

The fear and explanations create a potent combination that fuels different stages of chaos. Strong puts it in following order: avoidance, segregation, abuse, and pogroms. The epidemic of actions based on fear and speculative explanations is also bipolar dependent on human nature. Irrationality in the human beings will either yield actions or in-actions. Regulated actions like enforcement of health educations about topics that are usually not discussed (hand washing being the prime one) are desired. While regulated in-actions like prohibition of travel and so forth are also desired.

All such fears are led by irrationality, at a scale. While historical pandemics suffered from lack of information, we are suffering from an abundance of information. While the historic and the ancient had to tackle with magic and taboo because of lack of information, we sail through these analyses to find our what are we dealing with.

 
Read more...

from jiyometry

Historically, humans have endured several epidemics and pandemics. What makes the CoVID-19 epidemic different is, its co-existence with the information age. What is different in our experience from previous human experiences, considering we have information at our fingertips? This series of blog posts will be an auto-ethnographic account looked at through the lenses of Neil Postman and his theories about media. The posts will touch upon on themes like boredom, amusement, time perception, anxiety, panic, and epistemology.

 
Read more...

from shox

That time when there's much to gain and much to lose I was talking to an old friend who's in a different country and is in a crunch situation to crack an interview which is coming up soon. This reminded me of some of the trying times that I have had and those that I had the opportunity to be a witness to.

There's luck and effort both involved here. If you pick a tough question from the lot, you have a slight disadvantage, but then you should think of how far you've come in this journey of life. You've had your fair share of professional experience on the topic at hand. You're human and you've seen your fair share of human behaviour.

Some people say stay positive. For me, I need to stay negative too. I spend a bit of time visualising how things can go wrong, the myriad ways in which they could go bad. I don't feel so bad about it after I do it for a little bit of time. Most of these scenarios would never happen and if by chance one did, I am ok to deal with it. The ancient samurai used to meditate on their deaths every day. That made them resolute in their lives for that day. I reckon it was Gandhi who exhorted to learn like you will live forever and to live like there's no tomorrow.

We all have one thing in common on the earth. We all have just 24 hours in a day. During preparation, judiciously allot time for focused activities and keep plowing ahead in the time alloted for the mundane topics. There will be distractions. Keep moving ahead. Remember why you are doing this. Prepare. Keep preparing and revising.

When the actual event comes, steel yourself and become mercury. Randomness determines the question that you get for the exam. Your mindset determines how you deal with that question, be it an easy one or a tough one. It's important to listen and be empathetic with your interviewers. They are human too. Hungry, happy, angry, sleepy, anything. Mould and adapt. Don't be too aggressive, don't be too passive. Be patient. Don't be condescending. Listen and proceed. You have the groundwork done. This is doable, all it takes is effort and determination.

 
Read more...

from shox

Keep going, even when the going is tough (Chennai, May 28-2020)

“The world ain't all sunshine and rainbows. It is a very mean and nasty place and it will beat you to your knees and keep you there permanently if you let it. You, me, or nobody is gonna hit as hard as life. But it ain't how hard you hit; it's about how hard you can get hit, and keep moving forward.” – Rocky Balboa (fictional character)

I have always been a sucker for the underdog in movies and in sports. There is always a special kind of elation when the underdog tenaciously holds on, and manages to claw back into life, or success, or something on those lines. It hits a raw human chord somewhere within. That story can be watched again and again. Be it Rocky getting pummeled or Tom Cruise baiting Jack Nicholson into admitting that he issued the code red.

Recently, I read a couple of books (non-fiction) – Grit, and Mindset. Both were stating common sense wisdom. Both gravitate towards what Rocky the fictional character immortalized in the movies. You need to keep battling, you get better a tiny bit, one day at a time, one hour at a time, one moment at a time. Setbacks happen and what do you do? You step back and look at the bigger picture that is driving you to do what you do. Absorb it, and move on forward. Keep moving. Keep pushing. For those who are the living, our days are numbered.

There seem to be two key things. One is to keep moving. Two is to know why you want to move.

 
Read more...

from shox

The lockdown and containment in Chennai has proven to be ineffective, as skyrocketing numbers indicate.

The spiking numbers just indicate that the testing coverage has increased. The good part is the most of the cases in TN are reported to be asymptomatic and the death count here is very low (it is unlikely that the death count is massively fudged as it would have caused a controversy by now). Shops are open and vehicles are moving now. It is a good thing.

International borders were more or less open till the end of March, and markets in Chennai were functioning as usual during the lockdown. Common sense indicates that the virus has already spread wide and far BEFORE any lockdowns were imposed. The tests which started in full swing recently are just validating the spread.

As citizens, we need to ensure that we continue washing hands, wearing masks and sanitizing goods. But being terrified of something which is already at your doorstep doesn't help. There's no need for fear. Let's deal with this.

 
Read more...

from shox

Is a lockdown necessary if the virus has already spread? (Chennai, May 4-2020)

I am taking a few minutes to reflect on the experiences from Chennai in the context of a lockdown. The last time I left Chennai was on Feb-28 to Trivandrum. When I landed there, there were people in masks and temperature guns screening people on the basis of their temperatures and their passports. The weekend passed by fairly peacefully and the coronavirus was still not a concern yet in other places.

I returned to Chennai on Mar-2 on AI-968, a flight which came from Sharjah to Trivandrum, and then to Chennai. We disembarked at the International Terminal and there were no checks at all for the coronavirus. All seemed well.

I heard from colleagues at my previous organization that their project mates had flown in from various hotspot countries in March, and had successfully reported to work. The firm requested them to go on self isolation for two weeks, just in case.

The last case I know directly is that of another colleague who flew in from Guwahati to Chennai, a few days before the Janta Curfew. She had observed that there was not much checking and exiting the airport was a breeze.

Time for a wikipedia excerpt - “Chennai International Airport (IATA: MAA, ICAO: VOMM) is an international airport serving the city of Chennai, Tamil Nadu, India, and its metropolitan area. It is located in Tirusulam, 21 km (13 mi) from the city centre. The airport handled over 22.5 million passengers in the fiscal year 2018–19, with over 570 aircraft movements and 30,000 passengers per day. Chennai International Airport is the third busiest in international traffic and cargo capacity in the country behind New Delhi and Mumbai.[4][5] It is the fourth busiest airport in country's overall passenger traffic behind New Delhi, Mumbai and Bangalore.”

We know now that the COVID-19 patients may or may not be symptomatic. The asymptomatic patients, I would assume, would be less effective spreaders than a comparable symptomatic patient. They would have gone through all the temperature checks with flying colors.

Coming to the symptomatic patients, the airport would have welcomed 1000s into the city in 2020, till the last week of March. Not everyone stays in the city. Most would travel overland to their native villages/cities after arrival.

Let's just say for argument's sake, all these patients have been flying in to Chennai with or without knowing that they are carrying a bug, freely for 3 months. They in turn would have traveled all over and would have spread the virus far and wide as well. Now, the strange thing is that people should have been dropping like flies by now, but the death counts are low.

The death counts can be low for 2 reasons. 1 – they are actually low, corona or non-corona included. 2 – the numbers are being misreported. The misreporting is difficult to be caught but a large death spike should have been caught by social media at least.

What I am not able to piece together are 2 contradictory statements that I have been leading up to -

1 – There has been ample opportunity and time for the virus to spread in the state. 2 – The death counts are relatively low.

I do not take into account the COVID-19 positive counts in this article as the testing is limited and could be just the tip of an iceberg.

Given all this, I am starting to wonder if a lockdown is even necessary in this city?

(DISCLAIMER – I am not a medical professional or a data scientist. These are speculations.)

 
Read more...