Skip to content

Instantly share code, notes, and snippets.

💭
The Consciousness Has Shifted...The Awakening Has Begun

Rafal W. kenorb

💭
The Consciousness Has Shifted...The Awakening Has Begun
View GitHub Profile
@kenorb
kenorb / colab-example.py
Created May 18, 2020
Google Colab Qbitt example
View colab-example.py
#CODE
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd
@kenorb
kenorb / reddit-click.js
Last active Jan 17, 2020
How to click on Reddit 'more replies' programatically?
View reddit-click.js
document.getElementsByTagName("head")[0].innerHTML += '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"><\/script>';
setInterval(function() { $("div[id*='moreComments'] p").click(); }, 1000);
View ansible-keyring.sh
#!/usr/bin/env bash
#/
#/ Fetch Ansible vault password from GNOME keyring
#/
#/ How to configure:
#/ Set name of the VAULT_ID for the current Git repo: git config --local ansible.vault VAULT_ID
#/ Set password with GNOME keyring: keyring set ansible VAULT_ID
#/ Set environment variable ANSIBLE_VAULT_PASSWORD_FILE to the location of this file
set -eu
#
@kenorb
kenorb / lvm.txt
Created Apr 25, 2019
Volume group "ubuntu-vg" not found. Cannot process volume group ubuntu-vg. No key available with this passphrase.
View lvm.txt
grep use_lvmetad /etc/lvm/lvm/conf
sed -i'' "s/use_lvmetad = 1/use_lvmetad = 0/" /etc/lvm/lvm.conf
nvme1n1p3_crypt (NTFS?)
/dev/nvme0n1p3 (crypto_LUKS)
dumpe2fs /dev/sda1 # Change it to the right one.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Volume group "ubuntu-vg" not found.
Cannot process volume group ubuntu-vg.
@kenorb
kenorb / spinner.gif
Created Apr 25, 2019
Spinner (data:image/gif;base64)
View spinner.gif
data:image/gif;base64,R0lGODlhZABjAOZ/AOXv+P3+/tzp9Wug1ejw+cze8Hmp2Rxtvuvy+cDW7fz9/oGu21SRztXk846230OGyV6X0eLs98nd8Pb5/NLi8ou03jqAx+ry+abG5vH2+9jm9GGa0qnI557A4/b6/XKk18ba767L6LbQ6tDh8vD2+8LY7jR9xZq+4rTP6s7g8ZG436LD5L3U7ODr9oSv3H6s2t/q9kuLzJS64LrS62ie1Ji94ip2wuPt97DM6b7W7drn9I+339fl9KPE5Ymz3aTE5azK6PP3/MTa7qvJ55a84cfb77LO6VCOzc7f8SJxwC54w7jR6+Hs9mad05y/47LN6fD1+8TZ7pi+4r7V7HWm2LjS69Pj83uq2afH5v////7+//j7/fn7/fr8/u/1+/v8/v7///r8/e70+vX4/PT4/Pv9/rvT7KXF5mSb09vo9erx+fX5/Ofw+Pf6/UWIytHh8t3p9bvU6+/1+vr7/a/L6LzT7KzJ6Cl2wrfR6hFmu3Cj1lmU0EGFyYiy3aDC5P///yH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodH
@kenorb
kenorb / ISFP.txt
Created Apr 25, 2019
ISFP (Composers temperament)
View ISFP.txt
ISFP (Composers temperament)
> Composers are tactical entertainers, concrete in speech and utilitarian in action. In social situations, they are informative and attentive. Grounded in the here and now, Composers are extremely sensitive to their environment. They are attuned to the perceptions of their five senses even more than other sensing types are. They notice any little variations in their physical world or in the people around them. They are very sensitive to balance and understand well what does or does not fit, whether in a work of art or any other aspect of their lives. Composers are sensitive and sympathetic in the face of human suffering.
https://en.wikipedia.org/wiki/Composer_(role_variant)
https://en.wikipedia.org/wiki/ISFP
@kenorb
kenorb / click.js
Last active Apr 7, 2019
How to click on Facebook 'See more' programatically?
View click.js
setInterval(function() { document.getElementsByClassName("uiMorePagerPrimary")[0].click(); }, 30000);
@kenorb
kenorb / find_id_in_url.sql
Last active Apr 5, 2019
ELB: Most consuming URLs
View find_id_in_url.sql
CREATE OR REPLACE VIEW url_53847374125428073109782528 AS
SELECT
"sum"("backend_processing_time") "total_ms"
, "url"
FROM
elb_logs_2019
WHERE (("split_part"("request_timestamp", 'T', 1) LIKE '2019-01-%') AND ("regexp_extract"("url", 'sessionId=(.*)', 1) = '53847374125428073109782528'))
GROUP BY "url"
ORDER BY "total_ms" DESC
LIMIT 200
@kenorb
kenorb / rds_deny_backups_trigger.sql
Created Apr 4, 2019
Prevent backup database or backup log
View rds_deny_backups_trigger.sql
CREATE TRIGGER [rds_deny_backups_trigger] ON DATABASE WITH EXECUTE AS 'dbo' FOR
ADD_ROLE_MEMBER, GRANT_DATABASE AS BEGIN
SET NOCOUNT ON;
SET ANSI_PADDING ON;
DECLARE @data xml;
DECLARE @user sysname;
DECLARE @role sysname;
DECLARE @type sysname;
DECLARE @sql NVARCHAR(MAX);
@kenorb
kenorb / kern.log
Created Mar 27, 2019
NVIDIA crash (GPU has fallen off the bus)
View kern.log
This file has been truncated, but you can view the full file.
Mar 26 12:32:49 Ubuntu-PC kernel: snd_hda_codec_hdmi hdaudioC3D0: HDMI: invalid ELD buf size -1
Mar 26 12:33:05 Ubuntu-PC kernel: azx_single_wait_for_response: 56 callbacks suppressed
Mar 26 12:33:05 Ubuntu-PC kernel: snd_hda_codec_hdmi hdaudioC3D0: out of range cmd 0:4:707:ffffffbf
Mar 26 12:33:30 Ubuntu-PC kernel: sched: RT throttling activated
Mar 26 12:33:30 Ubuntu-PC kernel: NVRM: GPU at PCI:0000:65:00: GPU-cd57429b-a4d9-917d-72d6-1d9b6c4f6a3a
Mar 26 12:33:30 Ubuntu-PC kernel: NVRM: GPU Board Serial Number:
Mar 26 12:33:30 Ubuntu-PC kernel: NVRM: Xid (PCI:0000:65:00): 79, GPU has fallen off the bus.
Mar 26 12:33:30 Ubuntu-PC kernel: NVRM: GPU at 0000:65:00.0 has fallen off the bus.
Mar 26 12:33:30 Ubuntu-PC kernel: NVRM: GPU is on Board .
You can’t perform that action at this time.