Discover gists
This is a very often asked question among PHP developers. This gist aims to answer it.
- Done in DigitalOcean, cheapest droplet ($5), located in Singapore, using Ubuntu Server 18.04.3. (Referral link for anybody interested.)
- System configured with (mostly) default configuration, using what's available from the package installation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HackerRank's NodeJS environment allows the `request` package. | |
const request = require('request'); | |
function fetch(url) { | |
return new Promise((resolve, reject) => { | |
request(url, function (error, response, body) { | |
if (error) | |
reject(error) | |
else | |
resolve(body) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Decoding the data in /proc/net/tcp: | |
Linux 5.x /proc/net/tcp | |
Linux 6.x /proc/PID/net/tcp | |
Given a socket: | |
$ ls -l /proc/24784/fd/11 | |
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Python Black Formatter | |
;; package.el | |
(package! python-black) | |
;; config.el | |
(use-package! python-black | |
:demand t | |
:after python) | |
(add-hook! 'python-mode-hook #'python-black-on-save-mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
lista_npcs = [] | |
player = { | |
"nome": "Guilherme", | |
"level": 1, | |
"exp": 0, | |
"exp_max": 30, | |
"hp": 100, |
Remove SentinelOne agent from Mac
- Boot into Recovery Mode by holding Cmd+R during reboot
- Open Terminal from top menubar
- Run
/Applications/Utilities/Disk\ Utility.app/Contents/MacOS/Disk\ Utility
to open Disk Utility - If your startup disk is encrypted, use Disk Utility to mount it
- In Terminal, run
chroot /Volumes/Macintosh\ HD
- Execute the deletion commands or script
Remove SentinelOne agent from Mac
- Boot into Recovery Mode by holding Cmd+R during reboot
- Open Terminal from top menubar
- Run
/Applications/Utilities/Disk\ Utility.app/Contents/MacOS/Disk\ Utility
to open Disk Utility - If your startup disk is encrypted, use Disk Utility to mount it
- In Terminal, run
chroot /Volumes/Macintosh\ HD
- Execute the deletion commands or script
NewerOlder