Skip to content

Instantly share code, notes, and snippets.

@idiamant
idiamant / compfiles.py
Last active March 23, 2020 11:17
Sample of how to delete files from dir1 that doesn't exist in dir2 - Answer to post: https://www.facebook.com/groups/mac.israel/permalink/2941748212604513/
#!/usr/bin/env python
import os
import sys
dir1_list = os.listdir('dir1') # Directory with many files
dir2_list = os.listdir('dir2') # Directory with duplicates of dir1 and maybe others
delete_list = []
for filename in dir1_list:
if filename in dir2_list:
@idiamant
idiamant / SipClientOutbound.xml`
Created January 27, 2019 20:30
Twilio TwiML Snippet - SipClientOutbound
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial callerId="{{#e164}}{{From}}{{/e164}}">{{#e164}}{{To}}{{/e164}}</Dial>
</Response>
@idiamant
idiamant / ToSIPClient.xml`
Last active January 27, 2019 20:29
Twilio TwiML Code Snippet - ToSIPClient
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Sip>
{{To}}@someurl.sip.us1.twilio.com
</Sip>
</Dial>
</Response>
@idiamant
idiamant / iCloud-AddressBook-Recovery.sql
Last active June 15, 2019 07:55
SQL Query to extract contacts from iCloud Backup - AddressBook.sqlitedb
--
-- How to recover iPhone contacts from Backup files:
--
-- Recover contacts from AddressBook.sqlitedb of iCloud and iTunes backup
-- I used https://github.com/horrorho/InflatableDonkey in order to download AddressBook.sqlitedb from iCloud Backup the last backups made,
-- in order to recover some of my Wife's contacts that got lost while reconnecting her iPhone to her work's Exchange server.
-- * If you have 2FA for your Apple Account, you won't be able to login to the iCloud using the tool above,
-- without supplying the 6 digit token.
-- Use the following method in order to login from cURL, and by that get the Two step token on your Apple Device
-- (Copy the next 4 lines to bash shell, modify the APPLE_ID and APPLE_PASS env vars to your own details):