Author Archives: bullgare
MySQL 5.7 alter table blocking operations
Table 14.12 Online DDL Support for Column Operations
How to reinstall MacOS on M1 MacBook wiping previous admin
I’ve run into an issue when I gave my older MacBook with M1 chip to my wife. Even after reinstalling MacOS with a proper user for her and restoring from Time Machine, her admin account was not really the admin of that laptop. She was unable to create new users (MacOs failed to set a …
MySQL: generate and insert a range of dummy rows
There are a lot of ways to do this, but the one below is the most straightforward to me.
DataDog: use events in dashboards
Using events as datasource is pretty straightforward, and described here — https://docs.datadoghq.com/events/. To use it as a graph overlay (for instance, to show app deployments), you can edit your graph, Event Overlays, and add something like below:
1 |
tags:tool:morty,dd_env:$env [something like order-history-*] |
Fixing docker does not want to update images
If you run docker pull, and you see an error like failed to register layer: Error processing tar file(exit status 2): fatal error: runtime: out of memory, there could be 2 reasons. Obvious one — not enough disk space for docker. You can fix it with
1 2 |
docker system prune -af docker volume ls -qf dangling=true |
WARNING: It will remove your unused resources like …
How to add and increase swap on CentOS
Adding a swap file without reboot If you are having a dedicated server somewhere with not that much memory, you could decide to add a swap without rebooting your server. To do so, you need to follow the routine:
1 2 3 4 |
sudo dd if=/dev/zero of=/swapfile count=1024 bs=1MiB sudo mkswap /swapfile sudo chmod 0600 /swapfile sudo swapon /swapfile |
Increasing a swap size If something goes wrong with your system, and you see that …
How to safely update data in MySQL
1 2 3 4 5 6 7 8 |
CREATE TABLE IF NOT EXISTS my_tmp_copy LIKE my; INSERT INTO my_tmp_copy SELECT * FROM my; UPDATE my_tmp_copy SET order_count = 5 WHERE customer_id > 0; RENAME TABLE my TO my_old, my_tmp_copy TO my; |
Mock sql (sqlx) db on golang
I am using this library — https://pkg.go.dev/github.com/data-dog/go-sqlmock. That’s how you can use it for mocking db querying:
Backup your Spotify playlists and activity
* http://www.spotmybackup.com/ Simple tool to export all your data into a file. Also you can import it into your account. So it could be used to backup your Spotify data (uses json format, only track ids, no titles). * https://www.tunemymusic.com/ It allows to transfer data between different music services and also export to a csv …
Outline — simple and powerful vpn on your server
https://getoutline.org/ Just a couple of mouse clicks, and it will create a new droplet on DigitalOcean for you (or any other provider from the list). Very easy to install, and works good so far.