Creează un cont pentru a te abona la acest blog și a-i urmări articolele pe pagina Lectură.
-
Prerequisites Link to heading Go into root mode: sudo -i Look for your drive: lsblk -f # NAME FSTYPE LABEL # nvme0n1 # ├─nvme0n1p1 vfat EFI # └─nvme0n1p2 crypto_LUKS You should have: nvme0n1p1 → EFI partition nvme0n1p2 → root LUKS Usa…
-
Prereqisites Link to heading sudo pacman -S qrencode Also make sure you have a proper UTF8 font installed!
-
Install git and make in your terraform docker image: # ------------------------------------------------------------------------------ # Packages RUN set -exo pipefail && \ \ echo 'Installing packages'
-
Gems Link to heading Add these to your Gemfile: # Administration gem 'administrate', '~> 0.20.0' # Authentication gem 'devise', '~> 4.9', '>= 4.9.3' Then install your new gems: bundle install Generate Link to heading bundle exec rails generate devise:i…
-
Gems Link to heading Add these to your Gemfile: # Administration gem 'activeadmin', '~> 4.0.0.beta4' # Authentication gem 'devise', '~> 4.9', '>= 4.9.3' Then install your new gems: bundle install Generate Link to heading bundle exec rails generate acti…
-
Prerequisites Link to heading Install Docker Here.
-
Enable robots.txt in your hugo.toml (formerly config.toml): enableRobotsTXT = true Add a file layouts/robots.txt with: User-agent: GPTBot Disallow: / User-agent: * Allow: /
-
Setup Link to heading Add this to your ~/.bundle/config --- BUNDLE_GEM__TEST: "minitest" BUNDLE_GEM__CI: "gitlab" BUNDLE_GEM__MIT: "false" BUNDLE_GEM__COC: "false" BUNDLE_GEM__CHANGELOG: "false" BUNDLE_GEM__LINTER: "rubocop" Gem Name Link to heading Use…
-
Here is how you can make an assertion on a nested call to another class: let(:double) { instance_double('something') } before do allow(SomeClass).to receive(:some_method).and_return(double) allow(double).to receive(:another).and_return(true) end it…
-
Open your pacman.cfg file: sudo vim /etc/pacman.conf Uncomment or add these instructions: Color ILoveCandy Update your system with sudo pacman -Syyu.
-
Prerequisites Link to heading Create a basic file: echo "abc123" > test123.txt Digest Link to heading Find the sha256sum of a file with: sha256sum test123.txt You will get the following result: 5ecf8d2cc410094e8b82dd0bc178a57f3aa1e80916689beb00fe56148b1…
-
let result = document.evaluate( '/html/body/div/main/div[1]/div[3]/div', document, null, XPathResult.STRING_TYPE, null )?.
-
Put one noop task at the beginning and end of your role: --- - name: ToolInstall ansible.builtin.meta: noop #
-
If you’re tired of seeing these: evil-line-move: Beginning of buffer [81 times] evil-line-move: End of buffer [32 times] evil-forward-char: End of line [66 times] evil-backward-char: Beginning of line [66 times] Add these lines to your dotspacemacs/user-…
-
Let’s say you have a piece of code: class SomeThing def initialize(thing) @thing = thing end def call puts @thing.inspect end end You want to execute this in parallel in a ractor: Ractor.new { SomeThing.new(1).call } This works if you h…
-
If you run git init you will get this yellow hint: hint: Using 'master' as the name for the initial branch.
-
The best way to structure yout repository is to have an empty root commit and to squash all the other commits periodically onto the second.
-
Usage Link to heading sudo dd \ bs=4M status=progress oflag=direct conv=fsync \ if=/path/to/linux.iso \ of=/dev/sda Details Link to heading bs: Buffer size status=progress: shows 37497…
-
Steps Link to heading Fetch a command with either: C-e C-u: go to end of line, cut until beginning of line.
-
You should always check if the value is present in a list before adding it in. function prepend_path () { case ":${PATH}:" in *:"$1":*) ;; *) PATH="$1:${PATH}" esac } Usage Link to heading prepend_path ~/.local/bin Cleanup Link to…
-
Bash echo $PATH | sed "s/:/\n/g"
-
Docker Link to heading The best way to manage ruby for your project is by using Docker: Docker Images: basic Ruby setup Docker Projects If you don’t have a Docker setup yet, you have to suffer, temporarily, by using rbenv.
-
The instructions at https://brew.sh/ are extremely dangerous!
-
Setup Link to heading Your .gitignore: *.elc A Makefile containing: .PHONY: compile compile: @emacs -q -batch \ --eval '(setq byte-compile-error-on-warn t)' \ -f batch-byte-compile \ *.el The first indentation is a tab, the following two are s…
-
Package Link to heading Find the location of your diff-highlight package: Manjaro/Arch pacman -Ql git | grep diff-highlight Debian/Ubuntu dpkg -L git | grep diff-highlight Fedora rpm -ql git | grep diff-highlight Configure Link to heading Edit your ~/.…
-
Install Link to heading From package: # Manjaro / Arch sudo pacman -S ansible-lint # Alpine apk add --update ansible-lint From Docker (no official image so use mine): docker run --rm -it -v "$PWD":/work -w /work sdwolfz/ansible-lint:latest sh Configure…
-
Basic Link to heading sudo echo 'blacklist pcspkr' > /etc/modprobe.d/nobeep.conf And restart your machine!
-
HTML Link to heading <div class="tabs tab-right"> <style> .tabs input#tab1:checked ~ .tab-content-1, .tabs input#tab2:checked ~ .tab-content-2, .tabs input#tab3:checked ~ .tab-content-3 { display: block; } </style> <input type…
-
The command is: git diff --exit-code Prints the diff and exits with status code 1.
-
Are you a hardcore elisp programmer?
-
Install Link to heading npm init npm install --save-dev esbuild Setup Link to heading Add this to your esbuild.js file: const esbuild = require('esbuild') const targets = ['chrome58', 'firefox57', 'safari11'] esbuild.build({ entryPoints: ['src/main.j…
-
Tips Link to heading Disable garbage collection when benchmarking for more accurate results.
-
Prerequisite Link to heading Ruby Minitest and Simplecov starter Usage Link to heading # Create a mock mock = Minitest::Mock.new # Add expectations. # # Arguments: # 1.
-
Setup Link to heading Use the basic, standard, bundled, ruby HTTP library, no other gem needed. require 'net/http' url = 'https://www.codrut.pro' headers = { 'X-HELLO' => 'world' } use_ssl = true GET Link to heading params = { 'a' => 1 } result = nil
-
Locations: # System /usr/share/applications/ /usr/local/share/applications/ # Flatpak /var/lib/flatpak/exports/share/applications/ # Snap /var/lib/snapd/desktop/applications/ # Local ~/.local/share/applications/ Search for your application in those di…
-
History Link to heading View history: journalctl -b Tail history: journalctl -b -f Cleanup Link to heading sudo journalctl --vacuum-size=100M
-
You have the following: callable = proc { puts 'Hello' } Pass it to a function like this: def pass_me_something yield if block_given?
-
One argument: (defmacro macro-evaluates-arg (arg) "Evaluate `ARG'."
-
Rules Link to heading Here are my rules for git branch names: Don’t start with the letter m, that’s reserved for master or main.
-
JavaScript developers have no dignity!
-
Install Link to heading sudo pacman -S openbsd-netcat Use Link to heading With an IP: nc -v 127.0.0.1 5432 Or a URL: nc -v www.codrut.pro 443
-
netstat -atun Now either grep or browse to see if you accidentally exposed your database to the world.
-
Useful for all sorts of things: while true; do echo 'Inside the loop'; sleep 5; done
-
Setup package.json by running: npm init -y Add packages: npm install --save-dev \ @babel/core \ @babel/preset-env \ babel-loader \ webpack \ webpack-cli Create webpack.config.js with index.js as your main, and…
-
Read Link to heading file = CSV.open('path/to/file.csv', col_sep: ',') file.each do |line| pp line end Write Link to heading header = ['A', 'B', 'C'] content = [[1, 2, 3], [4, 5, 6]] csv = CSV.generate do |output| output << header content.each do
-
Every image or document you create has built in spyware, remove it like this: Install Link to heading sudo pacman -S perl-image-exiftool Usage Link to heading exiftool -overwrite_original_in_place -all= path-to-file
-
Prerequisites Link to heading sudo pacman -S gimp imagemagick poppler PDF to PNG Link to heading Create a directory with your INITAIL.pdf then execute this inside of it: pdftoppm INITIAL.pdf prefix-for-images -png Do whatever Link to heading Edit your i…
-
Prerequisites Link to heading Make sure you have systemd installed with at least version 248: pacman -Ss systemd | grep "core/systemd " # core/systemd 248.2-1.1 [installed] Setup Link to heading Check if the service is active: systemctl status systemd-o…
-
Navigate to your function.
-
find .