Viet's Blog

Make Grub Font Size Bigger

  • Sep 22, 2019
  • POST
By default Ubuntu/ElementaryOS configure their GRUB to use very small fonts. That really hurts my eyes. I decided to play with GRUB and increase the font size. The process is rather straight forward: Generate a GRUB-compatible font with specified size from a TTF (type-type font) Edit high-level GRUB configuration file Regenerate low-level GRUB configurations Restart and enjoy fruit of your labour I chose a mono-space font with size 36pt: DejaVuSansMono.

Endianness Agnostic ntoh

  • Jun 22, 2019
  • POST
From the Endianness detection blog entry, we have learned how to do that using predefined macros across different architectures. Our next task is to write ntoh (network to host) and hton (host to network) functions to convert integers and floating point values between network and host formats. Here’s a catch: Do not use conditionals - basically, do not use any of the keywords if/else/for/while. To make it even harder: Do not include any headers and also do not use #if/#else/#endif pre-processors.

Upcoming Posts

  • Jun 15, 2019
  • POST
I realised planning and making a wishlist would make me more productive and more focused. Hence, I decided to schedule time to write the following topics (not in any particular order): How to decode Ethereum UTC JSON files to extract private key Using SFINAE to check if a C++ class/structure implement a method Working with Hugo quirks and creating semi-automated posting C++ mix-ins for fun and profit Deriving Ethereum keys Manually sign and verify Ethereum messages Writing a JSON parser in OCaml Implementing a simple version of std::tuple Image source: https://www.

Taming Elementary OS

  • May 11, 2019
  • POST
ElementaryOS is a beautiful distro based on Ubuntu. It aims at satisfying Linux users with aesthetics or first time Linux users. Unlike developers of most Linux distros, ElementaryOS developers are not shy to suggest you to pay for play: Purchase your copy of ElementaryOS. The default price tag is $20, which I was happy to pay. I really love the distro’s sleek UI and an option to install free or buy more software at their AppCenter.

Fix Wifi for Ubuntu on Microsoft Surface

  • May 11, 2019
  • POST
Random wifi drops There are some pains using Ubuntu on laptops, especially on Microsoft Surface laptop. Wifi settings are not perfect and there are random drops of wifi after 10-15 mins. I did searching and found that one has to do at least 2 things: Prevent MAC address randomisation by default (that reduces security) /etc/NetworkManager/NetworkManager.conf [device] wifi.scan-rand-mac-address=no Stop automatic power saving for wifi /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf wifi.

Endianness Detection the Hard Way

  • Jun 17, 2018
  • POST
Recently I have had a project that involves serialisation (again!). I have written countless serialisers and deserialisers in 8 years of professional experience. As it goes with binary serialisation, you need to worry about Endianness of your machine because you want your code to be portable across multiple architectures. Text serialisations to JSON or mere CSV exempt you from all that headache, but they are too verbose and slow. In this post I will walk you through tricks to detect Endianness.

OCaml Packaging With Topkg and OPAM

  • May 28, 2018
  • POST
Dependencies First and foremost, you must have OPAM installed. Then you need to install the following packages: $ opam install topkg topkg-care topkg-jbuilder Boilerplate Code Given you have your library tested and ready for publishing, you need to add the files ppx_getenv01.opam and pkg/pkg.ml at the top: The OPAM file (ppx_getenv01.opam): opam-version: "1.2" name: "ppx_getenv01" maintainer: "Viet Le <XXXX@gmail.com>" authors: "Viet Le <XXXX@gmail.com>" homepage: "https://github.com/vietlq/ppx_getenv01" bug-reports: "https://github.com/vietlq/ppx_getenv01/issues" license: "MIT" dev-repo: "https://github.

Safer C++ By Handling Function Result

  • May 12, 2018
  • POST
Overview Despite best efforts to train, educate, warn developers to always capture and handle function results, one still can manage to forget and get burned in the process. Let’s say you have this piece of code that deals with critical process: int critical_func() { return 1234; } It’s far too common for folks to use critical_func() in this manner: int use_critical_func() { critical_func(); return 0; } The values returned from critical_func() could mean anything: Cannot connect to a service, balance is empty, rocket is faulty, … Failure to capture and act based on those return values could result in any undefined/undesired behaviour: Memory leak, crash, silent failures, … Let’s see how we can enforce developers to use return value from mission critical functions.

P2P Browsing Web With Beaker and Dat

  • Mar 31, 2018
  • POST
Recently I have been searching for a way to host websites in peer-to-peer manner. I had a quick look into Tor/Onion and I2P. They don’t instill lots of inspiration for non-tech users so I kept looking. I came across Beaker browser and Dat protocol that make browsing and hosting P2P websites simple and easy. This post will give you brief intro into Beaker and Dat so you can quickly embark and launch your own Dat website.

Edit and Annotate PDF

  • Mar 30, 2018
  • POST
I was looking for a tool to edit/annotate PDF files so I could complete a form and put my signature in the PDF file. Looks like Adobe has some expensive tool to accomplish that. Luckily for macOS one can use Preview to annonate and embed signatures in PDF files. It’s all free but you will need Apple Trackpad for signing. Follow the guides below: https://www.macworld.co.uk/how-to/mac-software/how-edit-pdfs-on-mac-for-free-3659723/ https://pdf.iskysoft.com/pdf-editor/free-pdf-editor-mac.html I also found Skim & Foxit Reader as recommended tools:
Next
LATESTS
Make Grub Font Size Bigger
  • Sep 22, 2019
  • POST
Endianness Agnostic ntoh
  • Jun 22, 2019
  • POST
Upcoming Posts
  • Jun 15, 2019
  • POST
Taming Elementary OS
  • May 11, 2019
  • POST
Fix Wifi for Ubuntu on Microsoft Surface
  • May 11, 2019
  • POST
Endianness Detection the Hard Way
  • Jun 17, 2018
  • POST
OCaml Packaging With Topkg and OPAM
  • May 28, 2018
  • POST
Safer C++ By Handling Function Result
  • May 12, 2018
  • POST
P2P Browsing Web With Beaker and Dat
  • Mar 31, 2018
  • POST
Edit and Annotate PDF
  • Mar 30, 2018
  • POST
CATEGORIES
TAGS
  • dev
  • tips
  • ubuntu
  • hugo
  • blog
  • c++
  • config
  • git
  • security
  • social-media

© Viet's Blog

Powered by Hugo.

Robust designed by Daisuke Tsuji.