Here are some actions and their shortcuts that will make you effective with VSCode. action shortcut notes search symbols ctrl + shift + o shows a searchable document structure, super handy for yaml or other long files navigation go to one of previous files ctrl + tab hold ctrl to observe a list of those find file by name ctrl + p makes it easy to navigate between files search any action ctrl + shift + p use this if you want to do something, but to not know a shortcut yet, or do not care to learn one open settings ctrl + , add a new line after current one ctrl + enter reformat document ctrl + shift + i there is nothing more daunting than formatting files by hand, this is not needed at all when you have “standard” formatting conventions....
IP Camera Mail Relay
I ran an Odroid C2 off site for periodic temperature measurements, relay control via GPIO and a mail relay for IP cameras. It served me well for about 7 years with no maintenance needed. There was a moment when Google deprecated SSL on their mail servers, and that made it impossible for Hikvision IP cams to send me pictures. Thankfully, it was possible to quickly hack together a relay on Odroid using Postfix which saved the day and worked ever since....
Homelab
Preface I have been a loyal customer of Contabo for 5 years straight since 2018. They are a provider of the cheapest VPS in the world, mine was 4 CPU / 12 GB RAM / 300 GB SSD for about €9. There was even an update to the plan at some point where I could get 6 CPU / 16 GB RAM / 400 GB SSD for the same price, I just needed to pay them €25 to perform the “migration”....
Heroes 3 tricks to extract more joy from the game
I love to play random maps in Heroes 3 (original complete edition with the amazing HD Launcher) against 7 original AI on Impossible difficulty, random choice of town. On top of that, my preferred mode of playing with a friend is Hot Seat. The following text is what keeps me enjoying this game after 20 years of playing and doing the same things over and over again. I remember coming across someone else’s saved games on our hostel’s LAN during my university days....
Clone Disk to a Smaller One With Clonezilla
Clonezilla allows to skip target disk size, and also has an option to create partitions on a new disk proportionally to the old ones. In my case there was an HDD with 6 partitions and Windows 10, total size - 500 GB. The last three were C:, D: and the recovery image. New SSD was only 240 GB, but as it turned out the partition backup made by Clonezilla took less than 200 GB....
Jetpack Compose Navigation Handling of Hilt View Model
Suppose you want to re-use a ViewModel across two full-screen composables, and for some reason you rely on hiltViewModel() from androidx.hilt:hilt-navigation-compose:1.0.0: @Composable fun Comp1(viewModel: SharedViewModel = hiltViewModel()) { ... } @Composable fun Comp2(viewModel: SharedViewModel = hiltViewModel()) { ... } Let’s imagine Comp1 navigates to Comp2. If you do not pass an explicit handle to existing instance of SharedViewModel to these composables, they will go ahead and create a new one for themselves....
Knee Deep in Trouble Merle Travis
(well I'm) kneeeeeeeeeeee deeeeeep in trouble (got the) saaaaaaame thing on my miiiiind (there's nothing) thrilling (and it's a) killing meeee -- just keep a kiiilling tiiiiime (it's agi)tating, wading -- it's aggravating (and I'm) left nothing come (to) looooung (I'll be) kneeeeeeeeee eeeeeee deeeeep in trouble -- till my baby comes home (tururu) pa tu bu bruuuu bu pa pu (I've had the) mumps, the bumps, (and) all kinda trumps (I've had the) groove and the hoop (in) call (I've had the) aches, the shakes, -- and everythang it takes --(to) really bump the good man off (but have my) troubles double --looodi, what a muddle --everythang's getting to beeeeeeeee -- aaaaammm standing knee deep in trouble --since my honey let me beeeee (well amm) kneeeeeee eeeeeee deeeep in trouble (got the) same thing on my maaaaaind (there's nothing) thrilling (and it's a) killing me --(to) just keep the killing taaaaaaaaim (it's agi)tating, wading, -- it's aggravating (and I'm) left nothing come(to) loooooong (I'll be) kneeeeeeee eeeeeeee deeeep in trouble -- till my baby comes hoououo-ome -- till my baby comes home comon home, baby -- till my baby comes hooooouume taaaaa aaaa puruppuumm (mm)datt'tee du weeeeee
Using Android Xml Layouts With Jetpack Compose
The documentation suggests to use AndroidViewBinding API for the task. I intended to learn Compose in my project, but also wanted a LineChart from MPAndroidChart library. Here is what I did. In the fragment: override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { val lineChart = FragmentChartBinding.inflate(inflater) return ComposeView(requireContext()).apply { setContent { SetContent(viewModel, findNavController(), lineChart) } } } And in the composable: @Composable fun setChart( state: State<List<BodyMeasurement....
Strapi Gatsby Blog
Here is the path I took to host my personal site with Strapi + Gatsby setup. I had only one previous experience hosting a personal website, that was self hosting with Ghost platform version 3. It was a good one with a very intuitive article creation and editing process. I decided to try something else, and then learned there are headless CMS solutions which may work with any static site generator....
Limit Network Bandwidth for a Virtual Machine on Linux
Something very useful - find the name of the virtual NIC on the host, and run a magical tc command: # ip l | grep vnet 47: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc htb master virbr0 state UNKNOWN mode DEFAULT group default qlen 1000 # tc class change dev vnet1 classid 1:1 root htb rate 100Mbit Here is an example of me using it to choke Steam: