Remember when my webserver was acting up? Well, I was so fed up with it, that I took a preconfigured Bitnami WordPress image and ran that on AWS. I don’t care how Bitnami configured it, as long as it works.
As a minor detail, postfix/procmail/dovecot were of course not installed or configured. Meh. This annoyed the Mrs. a bit because she didn’t get her newsletters. But I was so fed up with all the technical problems, that I waited a month to do anything about it.
Doing sudo apt-get -y install postfix procmail dovecot-pop3d and copying over the configs from the old server solved that.
Did I miss email during that month? Not at all. People were able to contact met through Twitter, Facebook, Telegram and all the other social networks. And I had an entire month without spam. Wonderful!
So yeah, my blog was off the air for a couple of days. So what happened?
This is what /var/log/nginx/error.log told me:
2016/06/27 08:48:46 [error] 22758#0: *21197
connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 194.187.170.206, server: blog.amedee.be, request: "GET /wuala-0 HTTP/1.0", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host:
"amedee.be"
So I asked Doctor Google “connect() to unix:/var/run/php5-fpm.sock failed (11: resource temporarily unavailable)” and got this answer from StackOverflow:
The issue is socket itself, its problems on high-load cases is well-known. Please consider using TCP/IP connection instead of unix socket, for that you need to make these changes:
in php-fpm pool configuration replace listen = /var/run/php5-fpm.sock with listen = 127.0.0.1:7777
in /etc/nginx/php_location replace fastcgi_pass unix:/var/run/php5-fpm.sock; with fastcgi_pass 127.0.0.1:7777;
Suppose you have a couple of .dll files that were built on a TeamCity server and you want to bundle them into a NuGet package and publish them on nuget.org, how would you do that if you were a Linux user? Is that even possible??? Let’s find out!
Preparation
First things first, lets create a clean working environment:
mkdir -p ~/repos/qa-nugetlinux
cd qa-nugetlinux
git init
gi linux,vagrant >> .gitignore
git add .gitignore
git commit -m ".gitignore created by https://www.gitignore.io/api/linux,vagrant"
vagrant init --minimal ubuntu/yakkety64
git add Vagrantfile
git commit -m "Add Vagrantfile"
vagrant up --provider virtualbox
This creates a Vagrant box where I will conduct my experiments. Let’s dive in and make sure that everything is up-to-date inside:
file nuget.exe
nuget.exe: PE32 executable (console) Intel 80386 Mono/.Net assembly, for MS Windows
Oops, silly me. It’s a Mono executable.
mono nuget.exe
The program 'mono' is currently not installed. You can install it by typing:
sudo apt install mono-runtime
Thank you for that helpful message, Ubuntu!
sudo apt-get -y install mono-runtime
16 MiB later, I try again:
mono nuget.exe
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
File name: 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
at NuGet.CommandLine.Program.Main (System.String[] args) in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
File name: 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
at NuGet.CommandLine.Program.Main (System.String[] args) in :0
System.Core is missing? OK let’s install that.
sudo apt-get -y install libmono-system-*
And try again:
mono nuget.exe
Could not load file or assembly or one of its dependencies.
Sigh. Ok, let’s use a cannon to shoot a mosquito:
sudo apt-get -y install mono-complete
Does it work now?
mono nuget.exe
NuGet Version: 3.4.4.1321
usage: NuGet [args] [options]
Type 'NuGet help ' for help on a specific command.
Available commands:
add Adds the given package to a hierarchical source. http sources are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#add-command.
config Gets or sets NuGet config values.
delete Deletes a package from the server.
help (?) Displays general help information and help information about other commands.
init Adds all the packages from the to the hierarchical . http feeds are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#init-command.
install Installs a package using the specified sources. If no sources are specified, all sources defined in the NuGet configuration file are used. If the configuration file specifies no sources, uses the default NuGet feed.
list Displays a list of packages from a given source. If no sources are specified, all sources defined in %AppData%NuGetNuGet.config are used. If NuGet.config specifies no sources, uses the default NuGet feed.
locals Clears or lists local NuGet resources such as http requests cache, packages cache or machine-wide global packages folder.
pack Creates a NuGet package based on the specified nuspec or project file.
push Pushes a package to the server and publishes it.
NuGet's default configuration is obtained by loading %AppData%NuGetNuGet.config, then loading any nuget.config or .nugetnuget.config starting from root of drive and ending in current directory.
restore Restores NuGet packages.
setApiKey Saves an API key for a given server URL. When no URL is provided API key is saved for the NuGet gallery.
sources Provides the ability to manage list of sources located in %AppData%NuGetNuGet.config
spec Generates a nuspec for a new package. If this command is run in the same folder as a project file (.csproj, .vbproj, .fsproj), it will create a tokenized nuspec file.
update Update packages to latest available versions. This command also updates NuGet.exe itself.
For more information, visit http://docs.nuget.org/docs/reference/command-line-reference
cd ~/vagrant/itextcore-dotnet/itext/itext.barcodes/
mono ~/vagrant/nuget.exe pack itext.barcodes.csproj -verbosity detailed
Attempting to build package from 'itext.barcodes.csproj'.
MSBuild auto-detection: using msbuild version '4.0' from '/usr/lib/mono/4.5'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
System.NotImplementedException: The method or operation is not implemented.
at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid1[T0] (System.Runtime.CompilerServices.CallSite site, System.Dynamic.T0 arg0) in :0
at NuGet.CommandLine.ProjectFactory.ResolveTargetPath () in :0
at NuGet.CommandLine.ProjectFactory.BuildProject () in :0
at NuGet.CommandLine.ProjectFactory.CreateBuilder (System.String basePath) in :0
at NuGet.CommandLine.PackCommand.BuildFromProjectFile (System.String path) in :0
at NuGet.CommandLine.PackCommand.BuildPackage (System.String path) in :0
at NuGet.CommandLine.PackCommand.ExecuteCommand () in :0
at NuGet.CommandLine.Command.ExecuteCommandAsync () in :0
at NuGet.CommandLine.Command.Execute () in :0
at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) in :0
That seems like a big ball of NOPE to me… According to this GitHub comment from a NuGet member, this is to be expected.
Hand Crank the .nuspec File
So it’s going to be the hard way.
<TO BE CONTINUED> This blog post was a draft, and I decided to publish whatever I had already, and if anyone is ever interested, I may or may not finish it. ¯_(ツ)_/¯