Skip to content

Instantly share code, notes, and snippets.

View rwp0's full-sized avatar
📚
On one's own way, at one's own pace…

Elvin Aslanov rwp0

📚
On one's own way, at one's own pace…
View GitHub Profile
@rwp0
rwp0 / emacs.org
Last active March 21, 2021 14:55
software environments

emacs

emacs packages

cperl
perl (language)
term
perl(1) (interpreter)
magit
git, github (melpa)
pde
perl
@rwp0
rwp0 / 0.md
Last active March 21, 2021 16:18
sources

sources

source materials (resources) for reference and learning (lists, draft, code)

org mode not rendered (on pinned repositories)

@rwp0
rwp0 / Rexfile
Last active July 5, 2022 12:17
FreeBSD package upgrade with Perl's Rex automation
use v5.36;
use Rex -feature => [ '1.4' ];
port 2222; # custom port
user 'root'; # PermitRootLogin prohibit-password
private_key '<path to SSH key>';
# password "<SSH key's passphrase>"; # passphrase if any
key_auth;
group servers => qw(
@rwp0
rwp0 / dbi.pl
Last active July 5, 2022 12:17
Perl DBI in Five Steps
#! /usr/bin/env perl
use v5.32;
use warnings;
use DBD::mysql;
my %mysql = (
host => 'example.com',
port => 3306,
database => 'example_database',
@rwp0
rwp0 / mysql_config_editor.sh
Created July 6, 2022 09:32
Creating MySQL login pathes
mysql_config_editor \
set \
--login-path="local" \
--host="localhost" \
--port="3306" \
--user="root" \
--password
# https://dev.mysql.com/doc/refman/8.0/en/mysql-config-editor.html
@rwp0
rwp0 / freebsd_manuals.js
Created July 16, 2022 18:48
FreeBSD Manuals JavaScript
javascript:window.open('https://www.freebsd.org/cgi/man.cgi?query=' + prompt('FreeBSD Manual'));
// Chrome:
// Settings -> Appearance -> Show home button (second option below "Net Tab page")
@rwp0
rwp0 / call.adb.sh
Last active July 28, 2022 08:20
Call from Android using ADB
adb shell am start -a android.intent.action.CALL -d tel:012910
# Saglam Aile
adb shell am start -a android.intent.action.CALL -d tel:012915
# Umico
adb shell input keyevent KEYCODE_ENDCALL
# End call
# https://stackoverflow.com/questions/25587147/adb-command-to-cancel-hang-up-incoming-call
@rwp0
rwp0 / lid.conf
Last active July 29, 2022 13:54
Debian GNOME Systemd: Don't Sleep on Locking the Lid
# /etc/systemd/logind.conf.d/lid.conf
HandleLidSwitch=lock
HandleLidSwitchDocked=ignore
HandleLidSwitchExternalPower=lock
# https://unix.stackexchange.com/a/628090/455788
# systemctl restart systemd-logind
# kills Xorg/Wayland session
@rwp0
rwp0 / user.grant.sql
Last active July 31, 2022 18:26
MySQL create database user and grants privileges with a single command
-- create database user and grant privileges with a single command
GRANT ALL PRIVILEGES
ON TABLE <database>.*
TO <user>
IDENTIFIED BY <password>;
SHOW GRANTS FOR <user>;
-- output: GRANT ALL PRIVILEGES ON `<database>`.* TO '<user>'@'%'
-- % is the default host for the user (ie. IP address or hostname where the user connects from)
@rwp0
rwp0 / move_sheet.google.js
Created August 2, 2022 12:46
Move Sheet to Last Tab
function move_sheet () {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheets_number = spreadsheet.getNumSheets();
// https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#getnumsheets
spreadsheet.moveActiveSheet(sheets_number);
// https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#moveActiveSheet(Integer)
}