Skip to content

Instantly share code, notes, and snippets.

View pcostarg's full-sized avatar

Pedro Costa pcostarg

  • Findmore
  • Lisbon, Portugal
View GitHub Profile
@pcostarg
pcostarg / Task-Kill-Port-Blocker.md
Last active January 4, 2023 16:02
Task Kill a PID blocking a port on Windows

Task Kill a PID blocking a port on Windows

Using npm scripts in parallelshell I got into a situation that a crash on it made node not quit gracefully and could not restart script as node was still listening to port 9090 (live-reload). this scripts find the process and kill it

Note: find command only works on command line

Get PID:

netstat -ano | find "9090"

@pcostarg
pcostarg / UnblockApacheOn443.txt
Last active January 20, 2017 18:25
XAMPP - Apache gets blocked on 443
Port 443 in use by "Unable to open process" with PID 8412!
Run command to find what is the process:
tasklist /fi "pid eq 8412"
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
Skype.exe 8412 4 59.468 K
Skype seems to use this ports from time to time, for some reason.
http://stackoverflow.com/a/247627/1671493
It depends on the hashing algorithm you use. Hashing always produces a result of the same length, regardless of the input. It is typical to represent the binary hash result in text, as a series of hexadecimal digits. Or you can use the UNHEX() function to reduce a string of hex digits by half.
MD5 generates a 128-bit hash value. You can use CHAR(32) or BINARY(16)
SHA-1 generates a 160-bit hash value. You can use CHAR(40) or BINARY(20)
SHA-224 generates a 224-bit hash value. You can use CHAR(56) or BINARY(28)
SHA-256 generates a 256-bit hash value. You can use CHAR(64) or BINARY(32)
SHA-384 generates a 384-bit hash value. You can use CHAR(96) or BINARY(48)
SHA-512 generates a 512-bit hash value. You can use CHAR(128) or BINARY(64)
@pcostarg
pcostarg / npmInstallConfigLinux.txt
Last active January 29, 2017 13:31
Install npm and use it on linux
#SRC: https://www.digitalocean.com/community/tutorials/how-to-use-npm-to-manage-node-js-packages-on-a-linux-server
sudo apt-get update
#or sudo apt-get install node
sudo apt-get install nodejs npm
#You can do that by typing:
npm completion >> ~/.bashrc
#Now, just source the configuration file to re-read the new changes you just added:
source ~/.bashrc
@pcostarg
pcostarg / DevEnv4PHPWindows.md
Last active November 9, 2017 18:38
Install Development Environment for PHP on Windows
  • Install VS Code
    • Install following extensions:
      • Code Runner
      • PHP Debug
      • PHP Intellisense
    • Restart VS Code
    • Add the following to user settings (pay attention to php.exe path):
    {

"code-runner.executorMap": {

@pcostarg
pcostarg / gist:f0a6ed60d7aca94a7f22d5c3875a415f
Last active December 28, 2022 14:29
Windows 10 Useful commands
powercfg /sleepstudy #report of system sleep and active modes
@pcostarg
pcostarg / $Profile.ps1
Last active September 15, 2022 16:14
windows Terminal and PowerShell customization
if ($Host.Name -eq 'ConsoleHost') {
Import-Module PSReadline
Set-PSReadLineOption -PredictionSource History
set-PSReadLineOption -PredictionViewStyle ListView
}
Import-Module -Name Terminal-Icons
$env:POSH_GIT_ENABLED = $true
Import-Module posh-git
@pcostarg
pcostarg / launch.json
Last active November 13, 2024 03:26
Vivaldi/Chrome/Edge - Remote debugging in VS Code with SPO/SPFx examples
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Chrome/Vivaldi",
"port": 9222,
"request": "attach",
"type": "chrome",
"url": "http://localhost:8080"
},