Skip to content

Instantly share code, notes, and snippets.

#!/opt/local/bin/php56
<?php
# Solution to "Bring the noise" challenge of Insomni'hack 2016 teaser.
#
# Time to run: few seconds, almost exclusively for reversing the hash.
# Second part to verify equations is extremely fast.
const REMOTE_HOST = 'bringthenoise.insomnihack.ch';
const REMOTE_PORT = 1111;
@fbonzon
fbonzon / itunes_genre_ids_scraper.php
Last active November 25, 2017 19:20
Scrapes and returns a list of all genre IDs, aka 'geID' tag in iTunes Store media files.
#!/opt/local/bin/php71
<?php
// Usage:
// ./itunes_genre_ids_scraper.php > itunes_genre_ids.pl
// Ref: http://www.apple.com/itunes/affiliates/resources/documentation/genre-mapping.html
const GENRES_METADATA_URL =
'http://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/genres';
@fbonzon
fbonzon / itunes_storefront_ids_scraper.php
Last active March 6, 2018 11:49
Scrapes and returns a list of all storefront IDs, aka 'sfID' tag in iTunes Store media files.
#!/opt/local/bin/php71
<?php
// Usage:
// ./itunes_storefront_ids_scraper.php > itunes_storefront_ids.pl
// Maybe we'll need to update those for future iTunes versions. With the user
// agent and store front HTTP headers, we trick the server into thinking that
// our requests come from iTunes.
const ITUNES_USER_AGENT =