Needed to check some XML output from a CalDAV service so I used curl, which is nice and simple. Only problem was that all the XML came back on a single long unreadable line. Turned out it wasn’t too difficult to get it formatted:
$ curl --digest --user usr:pwd -X PROPFIND | xmllint --format -
The key part here is of course the piping into
--format tells it to format the XML and the
- tells it to read the XML from standard in. The dash can be swapped with the path to an XML file, if you need to format already downloaded XML.
$ xmllint --format file.xml
Simple pimple dimple 🙂
Just a note to self in case I need this again.
> taskkill /F /IM application.exe
If you find yourself in the regular command line (cmd.exe) on Windows and you’d like to run a PowerShell script, you can do it like this:
> powershell ./example-script.ps1
Would be nice if you could just run it directly as a bat file though, right? And yes, you can! Continue reading How to run PowerShell scripts directly from Windows command line
Keep forgetting these lines, so sticking them here for future reference.
nuget spec SomeProject.csproj
Fix up created nuspec file afterwards.
Pack and Publish
nuget pack SomeProject.csproj -Build -Symbols -Properties Configuration=Release
nuget push [main nupkg file created by previous command]
This will pack and push to both the public NuGet feed and to SymbolSource.
Needed to check the HEAD of a URL on two Unix servers today. Goal was to check if routing, firewall and load balancer rules were all good. One server only had curl, and the other only had wget, so here are commands for both:
$ wget -S --spider http://geekality.net
$ curl -i -X HEAD http://geekality.net
Just a note to self, as I keep forgetting…
> mklink /d foo-current foo-1.0
> rmdir foo-current
> mklink /d foo-current foo-1.1
Say you have a bunch of files and you want to quickly change or remove the file extension of all of them. Turns out that’s very simple to do with the command-line in Windows. I had no idea…
Will change all files with ‘old’ file extension to have the ‘new’ file extension.
Will remove the ‘old’ file extension.