Skip to content

Instantly share code, notes, and snippets.

@madaboutcode
madaboutcode / callhistory.sql
Created June 14, 2014 17:17
Call history, ios, iphone, query
select datetime(date, 'unixepoch') as dd,address,duration/60,id,
case (flags>>15)&1 when 1 then '1' else '0' end || case (flags>>14)&1 when 1 then '1' else '0' end || case (flags>>13)&1 when 1 then '1' else '0' end || case (flags>>12)&1 when 1 then '1' else '0' end || case (flags>>11)&1 when 1 then '1' else '0' end || case (flags>>10)&1 when 1 then '1' else '0' end || case (flags>>9)&1 when 1 then '1' else '0' end || case (flags>>8)&1 when 1 then '1' else '0' end || case (flags>>7)&1 when 1 then '1' else '0' end || case (flags>>6)&1 when 1 then '1' else '0' end || case (flags>>5)&1 when 1 then '1' else '0' end || case (flags>>4)&1 when 1 then '1' else '0' end || case (flags>>3)&1 when 1 then '1' else '0' end || case (flags>>2)&1 when 1 then '1' else '0' end || case (flags>>1)&1 when 1 then '1' else '0' end || case (flags>>0)&1 when 1 then '1' else '0' end flagbin
, flags, answered from call where duration > 0 and face_time_data IS NULL order by dd desc;
// ==UserScript==
// @name Aliexpress - Orders to CSV
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://trade.aliexpress.com/orderList.htm*
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM_setClipboard
@madaboutcode
madaboutcode / commandline-fu.md
Last active November 23, 2020 06:44
Command Line Magic™

Command Line Magic

  • sort -u -t, -k1,1 file - Unique in column
    • u for unique
    • t, so comma is the delimiter
    • k1,1 for the key field 1
  • sed '/^$/d' myFile - remove blank lines from a file
  • find ~/ -type d -maxdepth 3 -exec du -hs '{}' \; - display usage for all folders in a directory
  • curl http://requestb.in/10wkj9v1 -x http://183.220.199.76:8123 - proxy testing
  • curl -o /dev/null -s -w "Connect: %{time_connect} \nTime to first byte: %{time_starttransfer}\nTotal time: %{time_total} \n" <url> - Webpage perf stats using curl
  • Portscan using netcat - nc -z -v 192.168.15.196 1-1000