Hi, A couple of days ago I’ve heard about Delta Chat , and for once I got thrilled with some piece of technology again. At the surface it’s just a chat app to the likes of Telegram, Signal and WhatsApp. The exciting part, however, is that is uses plenty of open standards technology under the hood. It’s a chat app built on top the regular e-mail protocols, SMTP and IMAP, with a…
Hi. After a series of hardware upgrades, I finally have 2x 2TB SDD for data on my NAS ! However, they are still configured with ~900GiB data partitions, and today it is time to expand it! Initial state The current disk layout is: # fdisk -l /dev/sda Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors Disk model: PNY CS900 2TB SS Sector size (logical/physical): 512 bytes / 512 bytes…
Hi! For years I lurked in the Home Assistant channel of a community Discord, but never had much interest in it. Earlier this month I had some discount coupons in hand and decided that it was time to give it a go. I got Home Assistant, the ZBT-1 and one IKEA Inspelning and managed to make it control my balcony lights. In my opinion, the sun “device” in Home Assistant might be the most…
Hi! I know I’m late to the party, but with the IPv4 exhaustion now being expressed in monetary costs by VPS/Cloud providers, it is time to seek IPv6. My main use-case is to be able to reach servers exclusively over IPv6, so I don’t need to pay for IPv4 assignments if those servers will not serve direct public traffic (i.e.: database, storage and job servers). My home provider did have…
Hi! I like Kubernetes, and having written my own operators in the past, you quickly grow fond of the high level of automation that it allows you to achieve. However, now that I’m spending the days building my own projects , my requirements (and budget) can’t fit k8s anymore. A couple of production VPSs and my GitHub Actions free quota is all I’m allowing myself to afford on…
Hi! Today I’m launching canastra.online ! It’s a website I’ve built where you can play Canastra for free, without ads, both single-player and multi-player. Canastra is a card game, quite popular in Southern Brazil. There are several variations of the game, but for now canastra.online only supports one set. Read the rules on our website. Building I’ve built the game in 2018…
Hi! I’ve spent a considerable amount of time this year rewriting my Canastra project in Go. While I wanted to write a specific post about this conversion, it has been over 6 months, so it’s unlikely it will still happen. For the purposes of this post though, all it matters is that the project is now built in Go, but the frontend and database architectures are still the same as…
Hi! For a few years now, my partner and I had a dilemma almost daily: what would we make for lunch/dinner that day? It’s not a matter of lack of skill or ideas for recipes, or even having the ingredients available, but more of a nothing sounds appealing for the amount of effort I want to put in cooking this meal type of situation. On top of that, I am particularly terrible to remember things…
Hi! I’m running Caddy and saving access logs to disk in the JSON format. I want to integrate fail2ban to block bots trying /wp-login.php and other known URLs, and I couldn’t find much about how to make fail2ban read Caddy’s logs. This is a hack that I quickly came up with, barely tested, but I managed to make it work: /etc/fail2ban/filter.d/caddy-forbidden.local : [Definition]…
Hi! I got some good feedback from @phxql@fosstodon.org related to my previous post : with flyway it’s possible to have a JavaMigration, which let’s you write custom code. So let’s test this out today! JavaMigration It took me a while to make this work. I couldn’t figure it out what it was meant by adding the class to the db.migration package . Some places mentioned…
Hi! It has been a long time since I last wrote any meaningful Java code. Aside from some Jenkins plugin debugging here and there, the bulk of my Java experience is from the 2000s, mostly desktop apps (Swing/AWT), so after a nudge from a friend I’ve decided to dust off my long forgotten Java skills and I set to rewrite YT Email using Spring as a learning exercise. First impressions A big…
Hi! I have an always-on Raspberry Pi at home, and once in a while I need to connect to something on my home network, or even exit to the internet as if I were at home (quite handy to access services that block datacenter/country IP ranges). This post documents all the steps needed to make it work. Architecture My home connection is behind a few of layers of (CG)NAT, so I can’t connect to it…
Hi! I used to self-host a NAS in my home network out of a Raspberry Pi 4B and a couple of HDDs, but after a few years I’ve learned that the Pi is somewhat underpowered for my needs, getting in the way of my backup strategy. Once in a while I would search for NUCs and other small form factor computers, but I never found something in the range that I was comfortable to pay. Eventually,…
Hi. A couple of years ago I “took inspiration” for a HTTP reverse proxy in Go from Stack Overflow without putting too much thought into it, and this week it bit me back. A co-worker found out that it was normalising some URLs ( /something//else will 301-redirect to /something/else ) against their will. So I decided to take the opportunity and understand better how net/http handles…
I briefly outlined in my ZFS backup strategy blogpost about my NAS setup, but here it’s a quick recap: I have a Raspberry Pi 4 4GB with a 1TB SATA HDD over USB running under the TV in my living room, and a second USB HDD for mirroring. I’ve been running this setup for around 18 months now, and unfortunately it doesn’t quite fit my needs. In the previous post, I focused too much…
It has now been close to half a decade since acquisition of my Lenovo Y720-15IBK , so I thought about writing an update this machine, given it is still my main personal machine, seeing almost daily usage for general browsing and a bit of programming. I also game on it semi-regularly, having played a good deal of Forza Horizon 4 (Ultra @ 1080p) and ETS2 over this holidays season. Hardware Upgrading…
As far as I remember, you can’t create a write-only key via Backblaze’s dashboard without also giving read access to the key. I want to use this specifically for uploaders in servers, so, if compromized, an attacker can’t read data out of the bucket. $ curl https://api.backblazeb2.com/b2api/v2/b2_authorize_account -u 'MASTER_KEY_ID:MASTER_KEY_SECRET' { 'apiUrl':…
I am now doing some experiments running my own NAS at home (mostly out of boredom), and I went with a small solution that goes inside my IKEA PS with a Raspberry Pi 4, a couple of 1TB USB SATA disks and ZFS on Linux mirroring them. I have less than 200GB in data and a very stable 50Mbps uplink at home, so this post explains my strategy to backup my data in a remote location. Before I even started,…
It’s almost a year since I purchased this gaming computer and just now I had the need to do anything else than gaming in it. I have a friend that recently bought a notebook with a Nvidia GTX 1060 and he installed Fedora, making it a very snappy workstation, so I decided to give Fedora a go again. My computer came with Windows 10 by default and I never changed anything there, so here I am…
That’s not a new thing, but I happened to use it during the weekend to be able to access some services back in Brazil that were IP-limited and HideMyAss couldn’t help, so I asked a friend for a small proxy help. What I did on my side: Opened a port on my modem to forward the connection to the port 51000 on my computer; Started a container: docker run -p 51000:51000 -p 51001:51001 --rm…
This week’s task was optimising Magento for large carts (100+ different products) and a profiler is a good tool to find small pieces of code that could be optimised. Blackfire was my choice, mostly because previous experience, but also because it is not a resource hog like Xdebug, which was taking around 6 minutes while Blackfire took only 20 seconds in the same type of request. Companion…
Hi, It’s common to use netcat utility to work with SSH ProxyCommand, which allows to use a bridge server, very useful when you need to connect directly to a host behind a firewall. Example: # File: ~/.ssh/config Host workbox HostName 192.168.1.92 # The ip address that the bridge server can see User anotherusername IdentityFile ~/.ssh/id_rsa ProxyCommand ssh myusername@firewall.company.com nc…
Today I was working in a 3rd party module. Something very simple, an AJAX Add to Cart button. But, when I requested http://.../ajaxcart/cart/add , I’ve got a 302 HTTP status, or, a redirect, to the same requested URL, but in secure mode (HTTPS). After debugging, I could understand that the controller wasn’t being called, so I try to find a configuration problem. The Administration…
Quick tip to use regex on nginx’s server_name directive. Using a specific root directory for every subdomain: server { listen 80; server_name ~^ ( .* ) \. project \. com$; root /home/www/project/$1; } Using an environment variable with a single project: server { listen 80; server_name ~^ ( .* ) \. project \. com$; fastcgi_param CUSTOMER $1; root /home/www/project; } You can also use the…
Quick tip on KDE based Debian: When you receive the following error when trying to run a X application with sudo: kassner@brian:~$ sudo unetbootin No protocol specified unetbootin: cannot connect to X server :0 Run the following command and try again: kassner@brian:~$ xhost SI:localuser:root localuser:root being added to access control list
Quick tip: When have a code like this: { % raw % }{ % trans % } prefix . {{ varname }}{ % endtrans % }{ % endraw % } And receive this error: Twig_Error_Syntax: A message inside a trans tag must be a simple text You can use the following piece of code as workaround. { % raw % }{{ ( 'prefix.' ~ varname ) | trans }}{ % endraw % } PS: maybe this is not the best way to go.
Hi folks, Today I struggled over an already known bug on Symfony2 when using UniqueEntity and Entity Inheritance. In the bug discussion, @gentisaliu recommended using a custom repository, and how do this I’m documenting here. Entities: /** * @ORM\Table(name='parent') * @ORM\Entity(repositoryClass='Repository\Parent') * @UniqueEntity(fields={'name'}, repositoryMethod='findByName', message='Name…
Hello. Today I bumped into a problem with ping: kassner@brian$ ping git.company.local ping: unknown host git.company.local Of course, it’s a local address, so maybe I forgot to add the local DNS server. Let’s check: kassner@brian$ dig A git.company.local ; < <>> DiG 9.8.4-rpz2+rl005.12-P1 < <>> A git.company.local ;; global options: +cmd ;; Got answer: ;; ->>HEADER< <- opcode: QUERY, status:…
Hi Folks, A little note to work with product object in Magento: /** * Using setStoreId two times, otherwise it will save the data to default store */ $product = Mage :: getModel ( 'catalog/product' ) -> setStoreId ($storeId) -> loadByAttribute ( 'ean' , $ean) -> setStoreId ($storeId);
Mental note: If you are moving the Rewrite from .htaccess to VirtualHost configuration and get a 400 Bad Request error, one or both tips below can be useful: RewriteEngine On # Use the %{DOCUMENT_ROOT} RewriteCond % { DOCUMENT_ROOT } % { REQUEST_FILENAME } -s [ OR ] RewriteCond % { DOCUMENT_ROOT } % { REQUEST_FILENAME } -l [ OR ] RewriteCond % { DOCUMENT_ROOT } % { REQUEST_FILENAME } -d…
Hello A little tip to convert AVI files to DVD with embed subtitles. Installing tovid: sudo apt-get install tovid Converting AVI file to a DVD-ISO file. tovid -dvd -in Video.avi -subtitles Legenda.srt -out Video /usr/share/tovid/makexml Video.mpg -out Video export VIDEO_FORMAT = NTSC /usr/share/tovid/makedvd Video.xml mkisofs -dvd-video -udf -R -o Video.iso Video/ So, you just need to burn your…
Hello. After an intense debug into Magento, we ( Filipe Ibaldo and me) have found two problems in Magento code, related to slow Place Order with many products in cart (not many qty of a product). One of the problems is the order item save, which is executed precisely in app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Parent.php , on afterSave method, who spent many time on my machine…
Hello. Today I found a problem in Zend Framework and his class autoloader, where an class_exists function call fires the Zend Framework autoloader. The function has an option to ignore the autoloader, but any class that I need loaded by Zend_Loader will return false. Then, if I call class_exists without disable autoloader, I got an file not exists PHP warning, that’s why Zend_Loader doesn’t check…