I wanted to get back to writing and taking useful notes, because let’s face it, my recent musings were mostly just technical notes to self and to othergit ss to whom these could have been useful.
I did, however, dread it because every time I wanted to write, Jekyll or Ruby or some plugins would give me troubles and I would just surrender to my laziness and proocrastination and decide that maybe I have nothing too interesting to say if I gave up so quickly.
A few days ago I, for some reason, visited my blog and to my my great surprise realized that it is respongind with 404 error… I took me couple days to get into looking into it but once I did, I wasn’t sure what’s going on. I did not alter or change anything - my website just wasn’t working, even though I am sure it was working before.
Looking at google analytics, it turns out my blog went dark on September 20 2020…
I don’t know why or how… I suppose it was because of some changes GitHub made to their github pages hosting since my blog is generated with Jekyll and is hosted at Github pages.
The Jekyll thing deserves a separate mention and discussion. I have had a lot of frustrations like I mentioned earlier due to the fact that Jekyll and/or some plugins always had issues and whenever I wanted to write someting I had to, well, resolve these issues… and since it was pretty much every time I wanted to blog - I had some new issues, I just gave up.
I will follow up with a separate post on how I revived my 5 years old blog with Jekyll… A the moment as I type it, I am running on the latest ruby and the latest Jekyll. It was not a smooth sailing however and at some point I thought I’d have to compromise to running on Jekyll 2.X (the latest of which was 2.5.1 I think).
But, alas, here we are - running on the latest ruby and Jekyll versions with all the new bells an whistles (are there any?).
So… here’s to the renewed blogging.
I have been interested in Flutter for a while and it looks like this is finally the time when it will all come together and I will finally make the plunge from native development to Flutter…
Exciting times are ahead, so strap down, buckle up and and let’s go on this adventure together!
It is usually a good idea in general to add slight randomness to the start time of a cron job, especially if you are accessing some 3-d party resource to prevent flooding of 3-d party at the top of the hour or at the top of the minute.
This will run the cron job every day sometime between 2pm-3pm and 2am–3am in a randomized manner
0 2,14 * * * sleep $(expr $RANDOM \% 3600); ~/bin/batch_job
If you want just a bit of randomness then you can do something like this
0 2,14 * * * sleep $(expr $RANDOM \% 60); ~/bin/batch_job
Which will start the cron within the first minute of 2pm and 2am in a randomized manner
One note to make here is that $RANDOM is a 16 bit number and has limited range so
shuf
for example* * * * * command to be executed
– – – – –
| | | | |
| | | | +—– day of week (0 – 6) (Sunday=0)
| | | +——- month (1 – 12)
| | +——— day of month (1 – 31)
| +———– hour (0 – 23)
+————- min (0 – 59)
To force refresh the dependencies for gradle build you can first try running the task with --refresh-dependencies
switch
The whole command would be
gradle --refresh-dependencies <task>
If that does not work for some reason you can try removing the ~./gradle/caches
folder
rm -rf $HOME/.gradle/caches/
A little weekend project git-hooks-trello to be able to easily and automatically interface with Trello from your git repo.
Despite previous advice - do not use zopfli for alternative compression
If the images were manually optimized - turn off the cruncher. You can do zopli compression on the images unlike on the apps Use WebP (but support is only available since Android 4.0)
// Gradle Plugin 2.0+
android{
defaultconfig {
vectorDrawables.useSupportLibrary = true
}
}
Use proguard. It is tough and things break but it is worth it.
This configuration though will not use full blown ProGuard but use a built in simplified shrinker.
minifyEnabled true
useProguard false
use @Keep
annotation in code to generate ProGuard rules automatically during the build process
Open sourced tool ClassyShark
If you have not run a gc
yet and it has been less than 2 weeks (default gc setting) since the commits you lost were created you are in luck.
run git fsck --lost-found
to identify the dangling commits
You will get something like this:
Checking objects: 100% (7151/7151), done.
dangling commit fa8249bd69c8cdf796e84a35dbb41d7d0c8e8930
dangling commit ce46084419bb1dfdb150c3af289efc1aafc5c066
dangling commit 934bf7ca1a24cea55cbef66d330b522ea023733
dangling commit 9e0e15c2842838f1e0ad408ddc3ebe106454f962
dangling commit 36d1659104054279036e25c2d18406bddfdb848e
dangling commit dfe36b11aeb25b1164167563f9d81211914df4f1
dangling commit 1665174227ec2bda0a1edb5353427a4fdee239ba
Great! You have the commits but which one is which? git show
to the rescue
find the commit you need with git show COMMIT_HASH e.g. git show fa8249bd
Once you find the commit you would like to get back to - last step is to merge it to your current branch
merge, e.g. git merge fa8249bd
–– Inteist
List the running VMs
vboxmanage list runningvms
Power Off specific VM with the name VM_NAME (the name can be obtained via the list command)
vboxmanage controlvm VM_NAME poweroff