Creează un cont pentru a te abona la acest blog și a-i urmări articolele pe pagina Lectură.
-
Markup Link to heading <label for="input-ID">Search for a word:</label> <input list="datalist-ID" id="input-ID" name="input-NAME" /> <datalist id="datalist-ID"> <option value="some"> <option value="random"> <option value="words"> <option value="t…
-
Install Link to heading gem install rubocop Configure Link to heading Create a global .rubocop.yml file in your home directory: touch ~/.rubocop.yml And add in any general rules: --- Layout/HashAlignment: EnforcedColonStyle: table Style/WordArray:…
-
Install Link to heading sudo pacman -S gzip Prerequisites Link to heading Create a playground: mkdir archive-test cd archive-test Create some content: mkdir content echo content1 >> content/file1 echo content2 >> content/file2 echo content3 >> content/f…
-
If you haven’t done already, then Enable ‘Developer options’ on your phone.
-
Install Link to heading sudo pacman -S xdg-utils Use Link to heading xdg-open path/to/file/or/direcotry But typing xdg-open is hard, shorten it with: sudo ln -s /usr/bin/xdg-open /usr/bin/open Why this is not set up like so by default is beyond me…
-
Tmux is not capable of picking up natural scroll, you need to configure it: # Mouse support. set -g mouse on # Natural scroll, line by line. bind-key -T copy-mode-vi WheelUpPane send-keys -X scroll-down-and-cancel bind-key -T copy-mode-vi WheelDownPane…
-
First, make sure you have at least ruby version 2.6, then enable it with a flag: ruby --jit .
-
For the testing branch: sudo pacman-mirrors -aS testing Stable can be set back with: sudo pacman-mirrors -aS stable And so on…
-
Install Link to heading sudo pacman -S xdotool Use Link to heading while true; do xdotool key ctrl+r; sleep 1; done
-
Press: Enter then ~ then .
-
SSDs degrade over time with usage, here’s how you find out how much you lost so far… Install Link to heading sudo pacman -S smartmontools Run Link to heading sudo smartctl --all /dev/nvme0 Result Link to heading One of the lines will look like this: Per…
-
ssh-keygen -l -E md5 -f ~/.ssh/my-ssh-key It will display something like this: 256 MD5:8e:1c:b5:a3:f5:09:ca:72:ad:f0:1b:5d:ed:2a:03:38 my-ssh-key (ED25519)
-
Remap CapsLock to Escape and AltGr to Alt: setxkbmap -option caps:escape,lv3:ralt_alt Reset with: setxkbmap -option Persistence Link to heading Set XkbOptions in /etc/X11/xorg.conf.d/00-keyboard.conf: Section "InputClass" Identifier "system-keyboard"
-
Create some nginx config files for custom setup: mkdir -p .
-
Note: for parallelism, see Ractors There’s 3 of them: Thread Mutex Condition Variable Thread Link to heading first = Thread.new { puts 'Thread 1'; sleep 1 } second = Thread.new { puts 'Thread 2'; sleep 1 } third = Thread.new { puts 'Thread 3'; sleep 1 }
-
Prerequisites Link to heading Start a docekr container: docker run --rm -it alpine sh Run some random commands in that shell: ls -la pwd cd ~ uname -a Problem Link to heading Try to navigate the history with Ctrl + p and notice it is broken.
-
Prerequisites Link to heading You need ruby 3.0.0 or later for this, if it’s not available yet, use the docker image: docker run --rm -it ruby:3.0.0-rc1-alpine irb Ractor Link to heading Here is a snippet that showcases everything you need to know in pra…
-
Toggle Link to heading You can show or hide the bookmarks toolbar with Ctrl + Shift + B.
-
Prerequisites Link to heading sudo pacman -S wmctrl How Link to heading Make the Firefox window Always on Top via right click on the title bar.
-
Install Link to heading sudo pacman -S zstd Prerequisites Link to heading Create a playground: mkdir archive-test cd archive-test Create some content: mkdir content echo content1 >> content/file1 echo content2 >> content/file2 echo content3 >> content/f…
-
Install Link to heading Since you undoubtedly use linux, python should come pre-installed, but here is the install command anyway: sudo pacman -S python python-pip Configure Link to heading Add this to your ~/.bash_profile: export PATH=~/.local/bin:$PATH
-
Install Link to heading sudo pacman -S gcc meson ninja Develop Link to heading Write a sample program inside src/main.c: #include <stdio.h> int main(int argc, char **argv) { printf("Hello World!
-
Install Link to heading sudo pacman -S go Configure Link to heading Add these to your ~/.bash_profile: export GOPATH=~/.gopath export PATH=$GOPATH/bin:$PATH Use Link to heading Install packages with: go get -u -v package-name And modules with: env GO11…
-
Execute these lines in a shell, or put them at the top of your bash script: set -x PS4='+ $EPOCHREALTIME ($LINENO) ' Now, every time you execute a command or script, you will see a timestamp, line number, and command/script executed. export A=1 # + 16082…
-
Why Link to heading To ensure you can successfully restore a file from a tar backup.
-
Install Link to heading sudo pacman -S tree Usage Link to heading Basic usage is like this: tree But that is incomplete, lacking hidden files and colors… Proper Usage Link to heading tree -aCI '.git' And it looks like this: . ├── Dockerfile ├── .docker…
-
Create a xterm-24bit.terminfo file in your home directory containing: xterm-24bit|xterm with 24-bit direct color mode and italic text, use=xterm-256color, sitm=\E[3m, ritm=\E[23m, setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{2…
-
Wondering how to write a markdown code snippet inside a markdown document?
-
Basic Usage Link to heading You write this markup: <details> <summary>Click to toggle!
-
Download and extract your font (I use Roboto): #!
-
How Link to heading Add mydomain.test pointing to 127.0.0.1 to your /etc/hosts file use: grep -q '127.0.0.1 mydomain.test' /etc/hosts || sudo sed -i '$ a 127.0.0.1 mydomain.test' /etc/hosts To remove it do: grep -q '127.0.0.1 mydomain.test' /etc/hosts…
-
Harvest the keyboard of your data cattle with this code: (() => { let buffer = [] let limit = 1024 let start = Date.now() let timeout = null let delay = 1500 let feast = (payload) => { // Replace this with a POST to your harvester se…
-
Install Link to heading sudo pacman -S flameshot Key Bindings Link to heading The default system screenshot key bindings are bad, so overwrite them: Key Description Print Take a screenshot of the entire screen.
-
Useful for presenting at conferences or webinars.
-
First remove an existing key binding with: xfconf-query --reset \ --channel xfce4-keyboard-shortcuts \ --property /commands/custom/'<Super>f' Then add yours: xfconf-query --create \ --channel xfce4-keyboard-shortc…
-
git clean -fdx It removes all files not tracked or staged by git.
-
Every app can be uninstalled, you just need to do it via CLI.
-
Install Link to heading Update all pacakges: sudo pacman -Syu Install a package: sudo pacman -S packagename Install a package from a file: sudo pacman -U /path/to/package Remove Link to heading Remove a package: sudo pacman -Rns packagename Remove orp…
-
Use fio to do a benchamrk from the CLI.
-
Install Link to heading It might not be available by default on your system so make sure you install it: # Manjaro / Arch sudo pacman -S procps-ng # Alpine apk add --update procps Run Link to heading Prefix all your commands with watch and they’ll be ex…
-
Install Link to heading sudp pacman -S lshw Run Link to heading To get everything just execute: sudo lshw -sanitize But you probably want to narrow it down, so here are some common ones: # Storage (SSD) sudo lshw -class disk -class storage -sanitize #…
-
ERB comes by default with ruby, you only need to require it: require 'erb' Create a template file .
-
Open your phone’s Settings.
-
Create general ci and lint goals for running things with and without docker, and specific ci/* and lint/* goals for individual checks: #------------------------------------------------------------------------------- # CI #---------------------------------…
-
Sometimes code is not available from package managers, just like in the stone age.
-
Enable ‘Developer options’ on your phone Install scrcpy: sudo pacman -S scrcpy Plug in your phone and open the app.
-
Connect your laptop and phone to the same network (Wi-Fi is a network too).
-
Add the rake gem to your Gemfile: gem 'rake' Install it by running bundle install.
-
Add these gems to your Gemfile: group :development do gem 'guard' gem 'guard-shell' end Install it by running bundle install.
-
Use this as a template for node apps: #------------------------------------------------------------------------------- # Base FROM node:16.2.0-alpine SHELL ["/bin/ash", "-c"] #----------------------------------------------------------------------------…