This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Info about the API: | |
https://www.weather.gov/documentation/services-web-api#/ | |
Get Temp and Barometric Pressure: | |
$ curl -s https://api.weather.gov/stations/KORF/observations?limit=1 |jq .features[].properties.temperature.value,.features[].properties.barometricPressure.value |cut -b-5 | |
List Stations | |
$ for X in `curl https://api.weather.gov/offices/AKQ |jq .approvedObservationStations[] -r`; do echo $X; curl $X |jq .properties.name; echo "---"; sleep 1; done > temp | |
Find the closest Forecast Office to lat/long: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
if (!isset($argv[1])) { echo "Give me a timestamp!"; } | |
$num = $argv[1]; | |
// Autoconvert from JS timestamp | |
if ($num>9999999999) { | |
$num = $num/1000; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$fd = fopen("php://stdin", "r"); | |
while ($line=fgets($fd)) { | |
$lx=explode(" ",$line); | |
echo date("Y-m-d H:i:s",trim($lx[0],"\t ;,.][{})(^&%$#@!=-\"':<>+/")); | |
unset($lx[0]); | |
$l=implode(" ",$lx); | |
echo " ".$l; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is what worked for me: | |
If you have Startup Disk Creator, Disk Utility, or GParted open, close them, then: | |
1. Safely remove your USB flash drive and reinsert it | |
2. If it isn't already installed, install GParted through the Software Center or: | |
3. sudo apt-get -y install gparted | |
4. Open GParted (in Xubuntu/Xfce it's in Settings) and select the USB drive from the dropdown near the top right | |
5. If there are any partitions on the drive, right-click them → Unmount | |
6. Device → Create Partition Table → Select new partition table type → msdos → Apply |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
// Read in a json formatted access log, grab the 'request' portion, and output just that, line by line. | |
// Together with a '|tr "\n" "\0" ' will all you to convert those logs to a wlog you can replay with httperf | |
$f=fopen($argv[1],"r"); | |
while ($line=fgets($f)){ | |
$urij=json_decode($line,TRUE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To make an image in OSX Mountable as -o loop would in Linux, run: | |
hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount ImageName.iso | |
it will then say something like "/dev/disk1" and you can mount that where you want it. |