Every now and then I run into some awesome open source project on GitHub, that is written in some cool programming language, and it assumes that the development tools for that language are already installed. My assumption is that they have a specific target audience in mind: an already existing developer community around that specific language. People who already have those tools installed.
The annoying thing is when someone like me, who doesn’t really need to know if a thing is written in Python or Ruby or JavaScript or whatever, tries to follow instructions like these:
$ pip install foo
Command 'pip' not found
$ gem install bar
Command 'gem' not found
$ yarn install baz
Command 'yarn' not found
$ ./configure && make && sudo make install
Command 'make' not found
By now, I already know that I first need to do sudo apt install python3-pip (or the equivalent installation commands for RubyGems, Yarn, build-essential,…). I also understand that, within the context of a specific developer community, this is so obvious that it is often assumed. That being said, I am making a promise:
For every open source project that I will henceforth publish online (on Github or any other code sharing platforms), I promise to do the following things: (1) Test the installation on at least one clean installed operating system – which will be documented. (2) Include full installation steps in the documentation, including all frameworks, development tools, etc. that would otherwise be assumed. (3) Where possible and useful, provide an installation script.
The operating system I’m currently targeting, is Ubuntu, which means I’ll include apt commands. I’m counting on Continuous Integration to help me test on other operating systems that I don’t personally use.
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!
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
And there was much rejoicing (Monty Python And The Holy Grail)
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. ¯_(ツ)_/¯
Soms moet ne mens al eens iets speciaals doen, zoals het nemen van een screenshot op een toestel dat wel Linux draait, maar geen X. Oink? Volgens StackExchange zou ik fbgrab of fbdump moeten gebruiken, maar dat is in dit concrete geval niet mogelijk because reasons.
In dit concrete geval is er een toepassing die rechtstreeks naar de framebuffer beelden stuurt. Bon, alles is een file onder Linux, dus ik ging eens piepen wat er dan eigenlijk in dat framebuffer device zat:
$ cp /dev/fb0 /tmp/framebuffer.data
$ head -c 64 /tmp/framebuffer.data
kkk�kkk�kkk�kkk�kkk�kkk�kkk�kkk�kkk�kkk�kkk�kkk�kkk�kkk�kkk�kkk�
IEKS!!! Alhoewel… Tiens, dat zag er verdacht regelmatig uit, telkens in groepjes van 4 bytes. “k” heeft ASCII waarde 107, of 6B hexadecimaal, en #6B6B6B is een grijstint. Ik had voorlopig nog geen enkel idee wat die “�” betekende, maar ik wist dat ik iets op het spoor was!
Ik heb framebuffer.data dan gekopieerd naar een pc met daarop Gimp. (referentie naar Contact invoegen)
Ik heb dus een Logitech Bluetooth Desktop MX5000. Al van in het begin heb ik daar problemen mee gehad in Ubuntu. Ofwel werken muis&toetsenbord, maar kon ik geen foto’s van mijn Nokia 6680 naar de pc sturen, ofwel omgekeerd. Lastig…
Gisteren was er een langverwachte update (3.9-0ubuntu2) van bluetooth in Ubuntu Feisty. Resultaat: muis en gsm werken, maar het toetsenbord niet. Dat is nog altijd lastig, maar het is een interessante wijziging!
Ik heb dan een oud PS/2-toetsenbord vanonder het stof gehaald, daarmee de gebruikelijke mantra ingetypt om verbinding te maken met een bluetooth device: sudo hidd --connect 00:07:61:XX:XX:XX terwijl ik tegelijkertijd op de connect-knopjes drukte op het toetsenbord en de bluetooth dongle. Ik moest wel héél snel zijn en een aantal keer opnieuw proberen, maar… (tromgeroffel) mijn toetsenbord werkt nu!
Ik gebruik al sinds 2005 Ubuntu, maar vandaag heb ik eindelijk ook de moeite genomen om de Ubuntu Code of Conduct te ondertekenen. Waarom? Omdat ik wel al eens wat bijdragen lever aan de mailinglijsten en dat kan daar wel eens een krabbenmand zijn. *kuch* (understatement) Ik probeer naar eer en geweten te handelen in al de Linux- en andere Free Software communities waarbinnen ik actief ben, en door de CoC te ondertekenen, leg ik dat commitment vast.
Het heeft wel wat voeten in de aarde gehad want je moet dan een document ondertekenen met pgp en dat is, om het beleefd te zeggen, niet echt een uitblinker qua gebruiksgemak. Ik vermoed dat ik pgp totaal verkeerd gebruik, maar iedere keer dat ik iets van pgp-keys nodig heb, verwijder ik al mijn vorige keys en maak ik er totaal nieuwe aan. Soit. Het hele proces bestaat uit 3 delen:
Dan de fingerprint copy/pasten in Launchpad. Even later krijg je een encrypted mail van Launchpad. Kopieer de inhoud van de mail naar een tekstfile en doe: gpg -d launchpad.txt Op het einde van te tekst staat een link om de OpenPGP key te bevestigen.
Ik ben momenteel bezig met een werkje voor de avondschool, voor het vak besturingssystemen. Het is een uitleg over multiprocessoren, gebaseerd op Sint-Tanenbaum en wat materiaal dat ik op het web gevonden heb.
In plaats van in het wilde weg wat te beginnen tokkelen, heb ik het (voor de verandering) eens systematisch aangepakt: met een mindmap. Eerst je gedachten ordenen, daarna pas beginnen tokkelen.
Hoewel ik momenteel in Gnome werk, heb ik toch maar het KDE-programma Kdissert geïnstalleerd. (Ik geloof trouwens niet zo erg in de KDE-Gnome-XFCE-[Flux|Open|…]box-Ion-… holy wars)
Dat programma is nu echt eens supersimpel in het gebruik: rechts klikken op een node om een nieuwe node toe te voegen, onderaan wat tekst intokkelen, enzovoort. Je kan de mindmaps zelfs exporteren naar OpenOffice.org, HTML, LaTeX, noem maar op. Wat wil ne mens nog meer? 😀
Uit een irc-log van 2007:
23:39 < Amedee> en, zou ik ook eens drupal installeren op m'n eigen site? ik ben bitweaver een beetje beu
23:52 < Digi-God> Amedee: wat is er mis met vim?
23:57 < Amedee> Digi-God: dat is schuurpoeder
Day changed to 07 feb 2007
00:37 < Amedee> et voila, 't staat er
00:37 < Amedee> morgen nog wa verder rondneuzen in dienen drupal
Op 7 februari 2007 ben ik dus officieel begonnen met Drupal. Van de blog in Bitweaver, of die daarvoor in TikiWiki, heb ik geen archief meer.
Onlangs, toen we met een aantal mensen van pandora.pub een terrasje deden op de Grote Markt in Sint-Niklaas, stopte JanC een kartonnetje met 2 cd’s in mijn handen, met de mededeling dat ik dit eens moest uitproberen.
Euh, ja, ok dan. Ubuntu, heet het, en het is een Linux distributie waar we volgens JanC nog veel van gaan horen. Ik ben eens benieuwd of het gemakkelijker in gebruik is dan de Gentoo die ik nu gebruik. Ik zal al lang blij zijn als ik niet meer alles van scratch moet compilen want dat is booooring… 😀
In het kartonnetje zitten 2 CD’s: een live-cd, om uit te proberen zonder iets aan het systeem te wijzigen, en een installatie-cd. Wie zelf interesse heeft, kan (gratis!) cd’s laten opsturen via ShipIt. Bestel ineens een grote hoeveelheid en deel ze uit aan vrienden en collega’s.