Wow. iOS is fussy about MPEG4 encoding. Stuff that worked fine as HTML5 video sources in Chrome and Safari on a Mac failed to load in various i-devices. In the end I re-encoded using FFMPEG
and:
ffmpeg.exe" -i input.mov -codec:v libx264 -profile:v main -preset slow -b:v 2000k -maxrate 400k -bufsize 800k -vf scale=-1:1080 -threads 0 -codec:a libvo_aacenc -b:a 192k output.mp4
If you're not restoring you're not backing up
Windows Server has this neat feature: Storage Pools. In a nutshell it separates the logical storage from physical devices. I use it to make two physical hard drives appear as one logical disk. Anything saved to the pool is mirrored to both disks. In theory, this means that a failure of one physical drive won't loose any data since a copy is available on the second.
Last week I had a drive failure. It wasn't either of the drives in the storage pool. Instead the system drive (a third drive hosting the OS) had failed.
I think it took me 40 minutes to be up and running enough to validate the data was okay.
- Install replacement system disk
- Reinstall Windows Server 2012 R2
- Reconnect two physical disks hosting the storage pool
- Trawl the interwebs for details of how to reattached the storage pool
Job done (except for the reboots and updates and reboots and updates thing...).
One trick, Windows server doesn't automatically mount a newly attached pool on reboot. Here'e the PowerShell rune to chnage that:
Get-VirtualDisk | Where-Object {$_.IsManualAttach –eq $True} | Set-VirtualDisk –IsManualAttach $False
More jottings on MPD (previously on m a n n i n g t r e e)
For those occasions where you don't have the bandwidth to watch something without buffering: youtube-dl
.
On a Mac:
sudo pip install youtube-dl
brew install libav
youtube-dl <url>
If bandwidth is a real pain and you just want the audio...
youtube-dl --extract-audio --audio-format mp3 <url>
To update:
sudo pip install -U youtube-dl
Simple scp from remote to me:
$ scp username@remotehost:file.txt /some/local/directory
Simple scp from me to remote:
$ scp file.txt username@remotehost:remote/directory
Here's a cheat sheet
cURL is a nifty little tool for doing things with the web (like HTTP Requests). It's expecially useful for playing with REST APIs...
A coleague was having some fun calling into the REST API of our issue tracking system. A perfect job for cURL I thought, until I remembered that I was VPN'd on a Windows box from a hotel bar...
Fortunately, the Git windows tool set includes Git Bash which includes... cURL
curl -D- -X PUT --data '{ "fields": {"assignee":{"name":"me"}}}' -H "Content-Type:application/json" https://testserver/rest/api/2/issue/Issue-135
curl -D- -X GET -H "Content-Type: application/json" https://testserver/rest/api/2/issue/Issue-134
to the rescue :-)
(Don't forget -u)
PS: I just stumbled on the fact that Git Bash also includes scp
. What goodness\tm!
A nice commandline tool (based on a Python wrapper for the OneDrive REST API) for working with OneDrive.
pywin32
0. Setup a Python Virtual Environment
1. On Windows, install pywin32
. From the venv use easy_install http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download
(with the path to the right pywin32 for your system and Python version...)
2. pip install pyyaml
3. pip install python-onedrive[standalone]
4. Register your app with the OneDrive service (to get the client and secret keys). MSDN details
5. Create a configuration file with the client ID and secret:
client:
id: <client id here>
secret: <secret key here>
- Auth dance
onedrive-cli auth
Then use. For example onedrive-cli ls
to list content stored in OneDrive.
Bonus thought
The OneDrive web service now has some basic Markdown support in the webage text editor, but http://dillinger.io/ is nice too ;-)
A nice little Python Script to send documents to Amazon Kindle via a command line.
(It works too :-)
Some Mac Tips...
Copy and Paste
to open the go to dialog, then:
to paste.
Links
Create a link to an application so I can easily run from a shell:
ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Bash
Bash setting are in the .profile
file.
To set a path:
To create an alias to a command:
Then reload the .profile
using the following from your home directory:
(Use ls -a
to show .
files)
Markdown is awesome.
So awesome that there's even a standardization effort to create one common markdown.
Aside
Aside: James asked what the big appeal was. For me it's a plain text format that has built in context with minimal distracting markup. As example:
# I am a title in **Markdown**
\chapter{I am a chapter title in \textbf{\LaTeX}}
<h1>I am a heading title in <strong>HTML</strong></h1>
End Aside
Markdown in Sublime text distraction free mode might be the best authoring environment, but it's far from the best reading (especially for non-Markdown fanatics). Fortunately, pandoc
exists to make conversions between formats easy. For example, to create co-worker friendly documents form .md
files I use:
pandoc -s --reference-docx=reference\reference.docx -o %1.docx %1
Where reference.docx
is a regular OOXML file (from MS Word) that sets up my default styles so that, for example, Markdown regular text uses the Segoe UI Light font family.
Nice.
Reference