RSSAmplifier

Blog

Hi, it's Barim. on Barim's blog · ابراهيم

Recent content in Hi, it's Barim. on Barim's blog · ابراهيم

barim.usRSS feed ↗74 posts

Latest posts

Fixing Firefox Error - cairo_xlib_surface_get_display

Problem Firefox fails to start with the following error: /lib/x86_64-linux-gnu/libgdk-3.so.0: undefined symbol: cairo_xlib_surface_get_display Cause Firefox loads libraries from /usr/local/lib instead of /usr/lib/x86_64-linux-gnu/ . The /usr/local/lib directory contains an outdated version of Cairo that is incompatible with the installed version of libgdk-3.

Displaying Images in lf with Kitty and Tmux

The Problem When using lf (the terminal file manager) with Kitty and Tmux, image preview display often causes issues: graphical artifacts remain on screen when switching from one preview to another, making the interface unreadable.

CSS Hack: Let Code Blocks Break Free From Container Width

Text prose and code have fundamentally different width requirements. Prose benefits from restricted width because lines of 50-75 characters are the fastest to read, reduce eye strain and movement, and let you track easily from line end to next line start.

YouTube thumbnails and uBlock Origin

It is possible to modify YouTube’s appearance using uBlock Origin. For example, to display smaller video thumbnails and get rid of “shorts” and of avatars :

Understanding Svelte Component Lifecycle and Reactivity

Svelte’s component system features a specific approach to reactivity and component initialization. This article explores a common misconception about how props, variables, and component initialization work in Svelte.

Tutorial: Dynamic Svelte Components

Svelte offers remarkable flexibility for creating dynamic components. In this tutorial, we’ll explore how to instantiate components on the fly and pass properties to them in an elegant and efficient manner.

Business web application

A business web application is a specialized software solution designed to help companies manage their operations effectively. Unlike generic apps such as e-commerce platforms (like Shopify) or booking management tools (like Doctolib), a business web app typically processes client-provided information, applies business-specific logic, and returns a result that helps achieve the companies goals.

Change screen input programatically on Linux

I have a keyboard/mouse/screen switch to connect 2 PCs: one running Linux and one running Windows. When I connect all the ports, it works, but every time I switch to the Windows laptop, the screen reconfigures, my windows are moved, and it annoys me. The switch behaves as if I had physically unplugged/replugged the screen, and Windows feels compelled to adjust the entire layout!

Use LanguageTool with neovim

I do a lot of mistakes when typing. The use of a spellchecker in neovim is easy but not enough : I mostly do grammar mistakes.

Create tabs in Svelte

I often need to code some way to have multiple pages rendered in the same location : think about a configuration panel with several sub panels. The natural way to code this is using tabs.

Tuto: Password Creation in Svelte

So, a few days ago, I saw a video showing a password creation form . Each time the user types anything, there is an instant validation with icons indicating which constraint is fulfilled.

Go Learning Resources

This is a list of useful resources you can access freely on the web, to learn Go : Go Playground : Try Go without installing nothing on your computer.

Tuto: Setup a Svelte project using esbuild

This article will show you how to set up a new Svelte project to develop a custom tag, using esbuild, with live reloading.

Tuto: Tags in Svelte

I want to code a simple tags input component in Svelte like the animation above. An input text where I can type words. As soon as I type a comma or Enter, the input turns into a “tag”. The tag appears next to the input text with a small cross to delete it. I can retrieve the list of tags in an easy-to-use data structure: for example, an array of string.

Is Go Object Oriented ?

During a discussion on a Discord channel, a message puzzled me: Go is not an object-oriented language. I knew Go didn’t have an inheritance mechanism. But, was that enough to disqualify it as an object language ?

Make Microsoft Edge coexist with i386

On my workstation, I manage both amd64 and i386 architecture. When I try to install Microsoft Edge on my Linux, after the apt update, I have this message:

Firefox tab less

We can customize Firefox interface to hide the tabs bar : First, we have to tell Firefox that we want to customize its interface.

Sqlite Pure Go

Would it be possible to embed a database to avoid managing a MySQL or Postgres instance? Even better, can this database be queried in SQL? I don’t want to learn another way to query data.

Experiment Nebula Mesh - Part 2

In my previous post , I used Nebula to setup a secured network between 2 virtual machines. This time, I’ll try to make a MySQL client and server communicate through a Nebula tunnel. And to make it a little bit more difficult, I’ll use podman to run the client and the server in containers.

Experiment Nebula Mesh - Part 1

Is it possible to use the public network, namely Internet, to make 2 machines communicate securely ? And if possible something easier to install and configure than OpenVpn ?

Udev Webcam

You can change the device link so your webcam will be always accessible at the same location /dev/video99. You can also persist some settings via the v4l-ctl command.

Console Font Size

This days, with 4K monitors, the linux console is unreadable : the font is too small. So how can we scale the font size in the console after boot ?

Git Rebase From Upstream

How to apply new commits in your forked repo from the parent (upstream) repo ?

Big clock in a terminal

How to show a big clock on Linux without using an application or having a browser opened on time.is ?

Change local ownCloud sync directory

To change the name of ownCloud main folder, there is a little trick you can do on Linux (may work as well on other platforms).

Local git

Define a repo somewhere in your file system with a bare init 1 mkdir -p /somewhere/repo/test_project 2 cd /somewhere/repo/test_project 3 git init --bare Now create a local folder for your work with init only

Mysql prompt tip

You can change the mysql prompt client so you know where you are. Very usefull when you manage a lot of mysql databases and you forget which one :-)

Disable tabs in Firefox

If you use a tiled window manager like me, Suckless DWM for example, and have Firefox as your browser, you may be interested by not showing the tabs.

Make your ubuntu LTS kernel up to date

Install LTS Hardware Enablement Stack 1 sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04 Clean 1 sudo apt purge --autoremove Reboot to load new kernel

Install iso on USB key using #Linux console only

How to flash any iso (think about your favorite distro) on an USB key without graphical IHM ? 1 sudo dd if = /path/to/image.iso of = /dev/sda status = progress “/path/to/image.iso” is the path to the ISO file /dev/sda is your USB key device (see below to get yours) : note that it is the whole device, not a partition (e.g. /dev/sda and not /dev/sda1) status=progress show flashing…

Force #wifi interface name on #Ubuntu 18.04

Using Udev, you can change the wifi interface name. First, you need to get the mac address.

VS Code loses Go autocompletion on Linux

On my Linux, just after upgrading Go to version 1.9, I lost autompletion functionality in VS Code. : vscode_completion_not_working This tip did not work for me.

Docker from scratch, Go and Multipart upload

To reduce docker container size we can built the image from scratch instead of using bloated images, like debian or worse ubuntu.

Samba public share

How to configure a Debian based Linux distribution to share a folder with anyone on the network, with read and write access ?

Convert PDF to PNG with enough resolution

As ‘man convert’ states : The convert program is a member of the ImageMagick suite of tools. Use it to convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.

Don't forget master infos in your MySQL dump

I tried to resync a slave MySQL after it disconnected from the master. But the binary log was already deleted on master, so the only solution was to restore from the last backup. To avoid lock tables on the master and remember the binary log name and position to put them on the slave configuration, there is a tip to take care of all that : the “- master-data” option in mysqldump.

Eve-style clock demo in Red, livecoded!

Red is a next-gen programming language, strongly inspired by REBOL .

Consul 0.7.1 | HashiCorp

Consul is a critical infrastructure service for organizations that rely on it for service discovery, key/value storage, and health checks.

Docker - Build, Ship, and Run Any App, Anywhere

Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud.

MySQL import from csv

To import a local CSV file into MySQL, use the syntax below : LOAD DATA LOW_PRIORITY LOCAL INFILE '/path/tofile.csv' INTO TABLE database.table FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (`field1`,`field2`,...)

MySQL export to csv

To export a mysql results in CSV format, use the syntax below : SELECT field1, field2, ... FROM table WHERE condition INTO OUTFILE '/tmp/toto.csv' FIELDS TERMINATED BY ';' ENCLOSED BY '"' LINES TERMINATED BY '\n' ;

Cheyenne server and POST size limit

By default, in Cheyenne, the header size limit for a post request is 102'400. If you want to ajust this limit you can define the post-mem-limit parameter in the global context or in a specific webapp. For example, to double the initial limit in the httpd.cfg, :

Boot Linux in text console

Get rid of graphic boot on Linux with a few modifications in grub configuration : 1 # edit your grub config 2 sudo vi /etc/default/grub 3 4 # remove splash, quiet, ... from GRUB_CMDLINE_LINUX_DEFAULT 5 GRUB_CMDLINE_LINUX_DEFAULT = 'text' 6 7 # save the file and update grub 8 sudo update-grub

French Git Log

Git log in colors.

mysql client : don't show columns names and grid

Default mysql client behaviour is to show column names and grid when returning results but how to get rid of this decorations ?

Allow invalid date in MySQL

Just in case you absolutely have to insert a date in MySQL that does’nt exist, eg 2014-02-30, you can run MySQL server in a special mode that authorizes such dates :

screencast with byzance on linux

byzanz-record -c - duration=60 - x=80 - y=310 - width=800 - height=600 out.gif

Not permitted to mount disk ?

A few days ago, I started to have a very disturbing “Not permitted” message when trying to mount a usb disk from Thunar . The only way I found was to pmount the disk : not as intuitive as just clicking the disk on Thunar.

How To Forward Outlook Emails With VB Script

In Windows, create a certificate via Start > All Programs > Microsoft Office > Microsoft Office Tools > Digital Certificate for VBA Projects In Microsoft Outlook, open the VB editor and copy/paste the code below Replace your@email.here and save Click on Tools > Digital Signature Click on [Choose] and select your certificate Click OK, then save and close the VB editor Create the Outlook rule with…

Invisible code sticks forever

A few months ago, I read an article about brain training by learning a new language : very interesting story about William Alexander who failed to learn french but strenghten his brain trying to.