Skip to content

Instantly share code, notes, and snippets.

Avatar

Mauricio Wolff bitbonsai

View GitHub Profile
View async.js
// or even better: https://blog.risingstack.com/mastering-async-await-in-nodejs/
// https://github.com/iagodahlem/clima-cli/blob/master/src/utils/weather.js
// https://github.com/axios/axios
async function f() {
let result = await e(1500);
let output = await d(result);
View delete-local-branches.sh
git branch --no-color | while read sha ref; do
git branch -D $sha
done
@bitbonsai
bitbonsai / .fun_npm_update.sh
Created Jun 2, 2018
Update all npm global packages
View .fun_npm_update.sh
function npm_update() {
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f2)
do
npm -g install "$package"
done
}
@bitbonsai
bitbonsai / br_whois.php
Created Dec 16, 2013
PHP Script with cURL to query the brazilian whois database
View br_whois.php
<?php
function get_br_whois( $url, $array_fields )
{
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "PHP Whois/Curl script", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
View coolest-ol-ever.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>test</title>
</head>
<body>
<style>
View 16.log
me at node1 in ~
NSS_SDB_USE_CACHE=YES strace -fc -e trace=access curl 'https://foobar.booking.com/' > /dev/null
Process 14247 attached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.000009 0 32 30 access
------ ----------- ----------- --------- --------- ----------------
100.00 0.000009 32 30 total
View 16.log
me at node1 in ~
NSS_SDB_USE_CACHE=YES strace -fc -e trace=access curl 'https://foobar.booking.com/' > /dev/null
Process 14247 attached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.000009 0 32 30 access
------ ----------- ----------- --------- --------- ----------------
100.00 0.000009 32 30 total
View 15.log
while (true); do
echo "$graphite_name_space.$(hostname|sed -e 's/\./_/g').dentry $(sudo slabtop -o | egrep 'dentry'|awk '{print $1}') $(date '+%s')"| nc 127.0.0.1 3002;
sleep 0.9;
done
View 14.log
me at node1 in ~
strace -fc -e trace=access curl 'https://foobar.booking.com/' > /dev/null
Process 2390 attached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.003180 0 6647 6643 access
------ ----------- ----------- --------- --------- ----------------
100.00 0.003180 6647 6643 total
View 13.log
MEM | tot 94.3G | free 9.2G | cache 5.4G | dirty 18.1M | buff 15.1M | slab 75.7G | slrec 75.5G | shmem 4.1G | shrss 0.0M | shswp 0.0M |
You can’t perform that action at this time.