Skip to content

Instantly share code, notes, and snippets.

@restyler
restyler / pcheck.sh
Last active August 30, 2024 02:29
CURL one-line proxy checker (shows connection speed, ip, and geo of proxy)
#!/bin/bash
# download, do chmod +x and copy to /usr/bin/local via ln -s /downloaded-dir/pcheck.sh /usr/local/bin/pcheck
# then launch as: pcheck http://user:pw@proxy-addr:port (to view ip and geo via lumtest.com website)
# or pcheck http://user:pw@proxy-addr:port https://www.google.com/ (to download specific website)
curl -w @- -sS -H "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" --proxy "$1" ${2:-"https://lumtest.com/myip.json"} <<'EOF'
\n
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
@restyler
restyler / gist:c3c4371f9bfb83302a3333d92762cd32
Last active May 29, 2023 07:10
Kill detached nodemon node.js process by node process port

When my VS code remote disconnects and looses my nodemon terminal after window reload, I always spend 3-4 minutes googling how to quickly kill the nodemonized process.

  1. Get pid by port (2355 in my case):

sudo lsof -n -i :2355

if you kill the found PID it won't help since nodemon will restart it. So, get PID from output (63073 in my case and..

  1. Now find the parent of this process (nodemon):
@restyler
restyler / search_recent_listings.php
Created November 1, 2020 09:03
Realtor.com API get recently listed properties for sale
<?php
// get your rapidapi key for API access on https://rapidapi.com/restyler/api/realtor-com1
define('RAPIDAPI_KEY', 'YOUR-KEY');
if (RAPIDAPI_KEY == 'YOUR-KEY') throw new \Exception('Get your API key before using the script!');
$curl = curl_init();
$search_params = [
'search' => '19720',
'year_built_min' => '1980',