tag:blogger.com,1999:blog-80098226629422767892024-03-13T15:10:35.415+01:00blog'o'lessA blog by an unpretentious system administratorUnknownnoreply@blogger.comBlogger109125tag:blogger.com,1999:blog-8009822662942276789.post-57077547454795946522018-04-08T09:35:00.002+02:002018-04-08T09:35:56.900+02:00The blog has movedI know, who cares?<br />
<br />
I think that I will no longer update this blog.<br />
I want to explore new ways to spread my crappy ideas and <span class="short_text" id="result_box" lang="en"><span class="">rubbish. :-)</span></span><br />
<span class="short_text" id="result_box" lang="en"><span class="">I want to try the way to self host a blog. Nothing serious, as always.</span></span><br />
<br />
<span class="short_text" id="result_box" lang="en"><span class="">However you can find my further posts here: <a href="https://blog.oless.xyz/">https://blog.oless.xyz</a></span></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-25970674704641175142017-11-27T21:35:00.000+01:002017-11-27T21:35:01.733+01:00micro:bit, bluetooth and Linux<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-vKJpxEZBtn0/WhwF1Bo_UHI/AAAAAAAACbM/VcwJGNdBEYU1vVnNykCY6fzVOveqA6scACLcBGAs/s1600/IMG_20171123_164335.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="768" data-original-width="1024" height="240" src="https://3.bp.blogspot.com/-vKJpxEZBtn0/WhwF1Bo_UHI/AAAAAAAACbM/VcwJGNdBEYU1vVnNykCY6fzVOveqA6scACLcBGAs/s320/IMG_20171123_164335.jpg" width="320" /></a></div>
<br />
<br />
<br />
<div id="gt-res-content">
<div class="trans-verified-button-large" dir="ltr" id="gt-res-dir-ctr">
<span class="short_text" id="result_box" lang="en"><span class=""> </span></span></div>
<div class="trans-verified-button-large" dir="ltr" id="gt-res-dir-ctr">
<span class="short_text" id="result_box" lang="en"><span class="">After various efforts I was able to read micro:bit sensors data from Linux. While temperature, and accelerometer data is not too difficult to collect, the UART service took a little more time, mainly due to a </span></span><span class="short_text" id="result_box" lang="en"><span class="">known issue in the micro:bit BLE implementation.</span></span></div>
<div class="trans-verified-button-large" dir="ltr" id="gt-res-dir-ctr">
<span class="short_text" id="result_box" lang="en"><span class=""><br /></span></span></div>
<div class="trans-verified-button-large" dir="ltr" id="gt-res-dir-ctr">
<span class="short_text" id="result_box" lang="en"><span class="">Here you can find my observations and experiments, with sample Python scripts: <a href="https://github.com/alcir/microbit-ble">https://github.com/alcir/microbit-ble</a></span></span></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-3822432165557522022017-08-05T07:42:00.000+02:002017-08-05T07:45:51.887+02:00Add speech to your Fedora system<i><span style="font-size: x-small;">This article first appeared on <a href="https://fedoramagazine.org/">Fedora Magazine</a></span></i>
<br />
<br />
By default, Fedora Workstation ships a small package called <i>espeak</i>. It adds a speech synthesizer — that is, text-to-speech software.<br />
In today’s world, talking devices are nothing impressive as they’re
very common. You can find speech synthesizers even in your smartphone, a
product like Amazon Alexa, or in the announcements at the train
station. In addition, synthesized voices are nowadays more or less
similar to human speech. We live in a 1980s science fiction movie!<br />
The voice produced by <i>espeak</i> may sound a bit primitive compared to the aforementioned tools. But at the end of the day <i>espeak</i> produces good quality speech. And whether you find it useful or not, at least it can provide some amusement.<br />
<h2>
Running espeak</h2>
In <i>espeak</i> you can set various parameters using command line options. Examples include:<br />
<ul>
<li>amplitude (<i>-a</i>)</li>
<li>pitch adjustment (<i>-p</i>)</li>
<li>speed of sentences (<i>-s</i>)</li>
<li>gap between words (<i>-g</i>)</li>
</ul>
Each of these options produces various effects and may help you achieve a cleaner voice.<br />
You can also select different voice variants with command line options. For example, try <i>-ven+m3</i> for a different English male voice, and <i>-ven+f1</i> for a female one. You can also use different languages. For a list, run this command:<br />
<pre>espeak --voices</pre>
Note that many languages other than English are experimental attempts.<br />
To create a WAV file instead of actually speaking something, use the <i>-w</i> option:<br />
<pre>espeak -w out.wav "Audio file test"</pre>
The <i>espeak</i> utility also reads the content of a file for you.<br />
<pre>espeak -f <i>plaintextfile</i></pre>
Or you can pass the text to speech from the standard input. In this
way, as a simple example, you can build a talking box that alerts you to
an event using a voice. Your backup is completed? Add this command to
the end of your script:<br />
<pre>echo "Backup completed" | espeak -s 160 -a 100 -g 4</pre>
Suppose an error shows up in a log file:<br />
<pre>tail -1F /your/log/file | grep --line-buffered 'ERROR' | espeak</pre>
Or perhaps you want a speaking clock telling you every minute what time it is:<br />
<pre>while true; do date +%S | grep '00' && date +%H:%M | espeak; sleep 1; done</pre>
<div id="gt-res-content">
<div class="trans-verified-button-large" dir="ltr" id="gt-res-dir-ctr">
<span class="short_text" id="result_box" lang="en"><span class="alt-edited">As you can guess</span></span><span class="short_text" id="result_box" lang="en"><span class="">, u</span></span>se cases are limited only by your imagination. Enjoy your new talking Fedora system!</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-51268315805864405122017-07-14T19:31:00.000+02:002017-07-15T11:49:42.724+02:00Firefox: usare la CNS su FedoraLa presente <i>guida</i> ha funzionato per me, su <b>Fedora 26</b>. Probabilmente è valida per altre distribuzioni di GNU/Linux (usando il gestore di pacchetti opportuno).<br />
Guida per modo di dire, poiché i passi da seguire sono veramente semplici.<br />
Alla fine del conto per installare il lettore e la Carta Nazionale dei Servizi (o Tessera Sanitaria), la <a href="http://www.regione.toscana.it/servizi-online/servizi-sicuri/carta-sanitaria-elettronica/guida-all-uso">procedura descritta sul sito della Regione Toscana</a> si rivela macchinosa e inutile.<br />
Viene qui usato un lettore di smartcard B4ID<br />
La carta invece è quella che sul sito della Regione viene identificata come <i>modello 2</i> (AT2012).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-uITqBa0-k14/WWiSllh9SkI/AAAAAAAACKc/xUJ8hD2UFCw9mgzCpn8LMjYAUgXo_WHSgCLcBGAs/s1600/IMG_20170714_104124.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1422" height="320" src="https://1.bp.blogspot.com/-uITqBa0-k14/WWiSllh9SkI/AAAAAAAACKc/xUJ8hD2UFCw9mgzCpn8LMjYAUgXo_WHSgCLcBGAs/s320/IMG_20170714_104124.jpg" width="284" /></a></div>
<br />
<h2>
Installare i pacchetti</h2>
Installate PC/SC Lite (Middleware to access a smart card using SCard API)<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo dnf install pcsc-tools</span><br />
<br />
Collegate il lettore e lanciare il comando:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">pcsc_scan -n</span><br />
<br />
Inserite la carta nel lettore. Dovrebbe apparire qualcosa del genere:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">Fri Jul 14 19:51:49 2017<br />Reader 0: ACS ACR 38U-CCID 00 00<br /> Card state: Card inserted, <br /> ATR: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX X</span><br />
<br />
Quindi ok, il lettore funziona. <br />
Se non funziona: SPIPPOLATE.<br />
<br />
Abilitate il servizio e fatelo partire:<br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">sudo systemctl start pcscd<br />sudo systemctl enable pcscd.service</span><br />
<br />
Installate OpenSC (<span class="col-11 text-gray-dark mr-2" itemprop="about">Open source smart card tools and middleware):</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo dnf install opensc</span><br />
<br />
<h2>
Firefox </h2>
Andate in Preferenze -> Avanzate -> Certificati<br />
Quindi Dispositivi di Sicurezza<br />
Pigiate sul tasto Carica<br />
Come nome del modulo mettete quel che vi pare<br />
<span style="line-height: 1.4;">Specificate quindi il percorso della libreria: <span style="font-family: "courier new" , "courier" , monospace;">/usr/lib64/opensc-pkcs11.so</span></span><br />
<span style="line-height: 1.4;">Premete ok.</span><br />
<br />
<span style="line-height: 1.4;">A questo punto dovreste vedere un nuovo device.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-9FOrX7CKVBw/WWiNAbiZyDI/AAAAAAAACKM/ujY_4zfQJ9oY3yugGvgyPyOQgw19CtT7wCLcBGAs/s1600/Screenshot%2Bfrom%2B2017-07-14%2B11-10-14.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="723" data-original-width="1464" height="315" src="https://3.bp.blogspot.com/-9FOrX7CKVBw/WWiNAbiZyDI/AAAAAAAACKM/ujY_4zfQJ9oY3yugGvgyPyOQgw19CtT7wCLcBGAs/s640/Screenshot%2Bfrom%2B2017-07-14%2B11-10-14.png" width="640" /></a></div>
<span style="line-height: 1.4;"></span><br />
<span style="line-height: 1.4;">Inserendo la carta dovrebbe apparire il nominativo e il codice fiscale.</span><br />
<span style="line-height: 1.4;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/--9VYnzpSyA4/WWiNg6Jfn5I/AAAAAAAACKQ/zx7FbooeYgQEDO2IlrUKzqnQClGbsrpvQCLcBGAs/s1600/Screenshot%2Bfrom%2B2017-07-14%2B11-10-30.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="768" data-original-width="1520" height="322" src="https://4.bp.blogspot.com/--9VYnzpSyA4/WWiNg6Jfn5I/AAAAAAAACKQ/zx7FbooeYgQEDO2IlrUKzqnQClGbsrpvQCLcBGAs/s640/Screenshot%2Bfrom%2B2017-07-14%2B11-10-30.png" width="640" /></a></div>
<span style="line-height: 1.4;">Premendo su Login dovrebbe venire richiesto il PIN della carta.</span><br />
<span style="line-height: 1.4;"><br />Ora potete</span><span style="line-height: 1.4;"> provare l'effettivo funzionamento collegandovi a un sito che richiede l'autenticazione via CNS, come per esempio <a href="https://accessosicuro.rete.toscana.it/">https://accessosicuro.rete.toscana.it</a> (dove trovate, fra l'altro, il Fascicolo Sanitario elettronico), oppure <a href="https://iris.rete.toscana.it/">https://iris.rete.toscana.it/</a> (per i pagamenti online della Regione Toscana). oppure il sito dell'INPS.</span><br />
<span class="col-11 text-gray-dark mr-2" itemprop="about"><br /></span>
<span class="col-11 text-gray-dark mr-2" itemprop="about">Con la tessera sanitaria è anche possibile richiedere le </span>credenziali <b>SPID</b>, il Sistema Pubblico di Identità Digitale: <a href="https://www.spid.gov.it/richiedi-spid#altre-modalita">https://www.spid.gov.it/richiedi-spid#altre-modalita</a>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-8009822662942276789.post-11191435400770714192017-07-12T18:30:00.001+02:002017-07-12T18:36:26.558+02:00How to install Fedora 26 on the Raspberry Pi (Headless and Wireless)<h2>
</h2>
<h3>
</h3>
The Raspberry Pi is the most famous SBC (Single-Board Computer). It is a recent news that over five millions of units were sold since it came out.<br />
<br />
There are a lot of Linux-based and not Linux-based operating systems that runs on the Raspberry: Fedora is one of the latest landed in this platform. Due to this fact, many things still don’t work: for instance, according to what you can read on the Fedora wiki, expansion HATs, composite TV out, analog sound port and the add-on camera are not yet supported; support for displays other than the official one is not currently planned, GPIO isn't well supported. In addition Fedora supports only Pi version 2 and later.<br />
Obviously the Raspberry Pi Foundation recommends the use of Raspbian, a Debian-based Linux operating system. And as stated before, there are many distributions that have been around for a long time, therefore they probably work better on such platform. Compared to the rest of the world Fedora on ARM could look at early stages of development.<br />
Then, due to these facts the question could be: why using Fedora on the Raspberry Pi when there are more feature rich and widely used distributions? The answer is: isn’t Fedora our favorite distro? So let’s give a try to the ARM version.<br />
Side note: ARM is an architecture officially supported by Fedora.<br />
<br />
Let’s get started.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-kk1nm0PGo-k/WWY2-nMSy8I/AAAAAAAACI0/TI_BS7T29iU8baqwZNfDO8OAJ49VZdeGQCLcBGAs/s1600/Screenshot%2Bfrom%2B2017-07-12%2B15-58-34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="374" data-original-width="1196" height="200" src="https://4.bp.blogspot.com/-kk1nm0PGo-k/WWY2-nMSy8I/AAAAAAAACI0/TI_BS7T29iU8baqwZNfDO8OAJ49VZdeGQCLcBGAs/s640/Screenshot%2Bfrom%2B2017-07-12%2B15-58-34.png" width="640" /></a></div>
<br />
<h2>
Preparing the SD card</h2>
The installation of the Fedora ARM image on an SD card is simple as these two steps:<br />
<br />
- download the raw image of your choice (in this case Minimal) from <a href="https://arm.fedoraproject.org/">https://arm.fedoraproject.org/</a><br />
<br />
- run this command (supposing you are running Fedora on your PC and that you have installed the fedora-arm-installer package via DNF)<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo arm-image-installer --image=Fedora-Minimal-armhfp-26-1.5-sda.raw.xz --target=rpi3 --norootpass --resizefs --media=/dev/mmcblk0 -y</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
Please refer to <a href="https://fedoraproject.org/wiki/Architectures/ARM/Raspberry_Pi?rd=Raspberry_Pi#Preparing_the_SD_card">the Fedora wiki</a>.<br />
<br />
Such command will blanks the root password (remember to subsequently set one during first setup) and it will automatically resize the root partition in order to fill up the SD card size.<br />
<br />
Once done, remove the SD card from your PC.<br />
<br />
<h2>
The serial console</h2>
If you do not have an HDMI screen to connect to the Raspberry Pi, or if you want to run a completely <b>headless</b> box, you have to enable the serial console.<br />
<br />
The task is different between the Raspberry 2 and 3. These steps are for the version 3:<br />
<br />
- insert the SD card in your PC, it should automatically mount three partitions<br />
<br />
- edit the file extlinux.conf<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo vim /run/media/<i>youruser</i>/__boot/extlinux/extlinux.conf</span><br />
<br />
add "<span style="font-family: "courier new" , "courier" , monospace;">console=tty0 console=ttyAMA0,115200</span>" to the end of the append line<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">append ro root=UUID=<i><uuid-uuid></i> console=tty0 console=ttyS0,115200</span><br />
<br />
- edit the <span style="font-family: "courier new" , "courier" , monospace;">config.txt</span> file in the root partiton<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo vim /run/media/<i>youruser</i>/<i>sometinglike-4AC9-BABE</i>/config.txt</span><br />
uncomment the <span style="font-family: "courier new" , "courier" , monospace;">enable_uart</span> line:<br />
<br />
enable_uart=1<br />
<br />
<h2>
The onboard wifi adapter</h2>
If you want to enable the onboard WiFi adapter, you have to download a file that Fedora can not currently redistribute in the raw image:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo
curl
https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm80211/brcm/brcmfmac43430-sdio.txt
-o /run/media/youruser/__/lib/firmware/brcm/brcmfmac43430-sdio.txt</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> </span> <br />
<h2>
Booting the Raspberry</h2>
Umount the three partitions, using something like<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">umount /run/media/<i>youruser</i>/__boot ; umount /run/media/<i>youruser</i>/__ ; umount /run/media/<i>youruser</i>/</span><span style="font-family: "courier new" , "courier" , monospace;"><i>sometinglike-4AC9-BABE</i></span><br />
<br />
Then insert the SD card in the Raspberry Pi, connect an Usb to Serial/TTL Adapter (the pin 8 on the Raspberry is the TX and pin 10 is the RX). Then power up the device.<br />
<br />
You can look at the boot process using a terminal emulator program like minicom or GTKterm, or even the simple screen command:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">screen /dev/ttyUSB0 115200</span><br />
<br />
<script async="" id="asciicast-KsNYUBmTfWOCYmcWha6yRrpvb" src="https://asciinema.org/a/KsNYUBmTfWOCYmcWha6yRrpvb.js" type="text/javascript"></script>
Once the boot process will reach the end, you should see the Fedora initial setup where you can create an account, set the root password, configure the timezone, etc.<br />
<br />
As soon as you log in, if the Raspberry is connected to the network using the Ethernet interface, and there is a DHCP server in the LAN, you are almost done. Check if you are really online and perform a system update:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo dnf update</span><br />
<br />
<h2>
Setup the wifi</h2>
If for some reason you can’t use the Ethernet interface and you need to connect to the WiFi network, you have to configure the wireless interface using the Network Manager command line interface (nmcli).<br />
<br />
For instance, if your network uses WPA or WPA2, and there is a DHCP this task is pretty simple:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">nmcli radio</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">nmcli device wifi connect <i>YOURSSID</i> password <i>secretpassword</i></span><br />
<br />
If you need to set up a static IP there are instead various steps to perform:<br />
<br />
Add a connection profile and set the IP/netmask and the default gateway<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">nmcli con add con-name <i>ConnectionName</i> ifname wlan0 type wifi ssid <i>YOURSSID</i> ip4 <i>192.168.100.200/24</i> gw4 <i>192.168.100.1</i></span><br />
<br />
Set up the DNS<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">nmcli con modify <i>ConnectionName</i> ipv4.dns "<i>8.8.8.8 8.8.4.4</i>"</span><br />
<br />
Configure the wireless security (in this case wpa-psk) and the password<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">nmcli con modify <i>ConnectionName</i> wifi-sec.key-mgmt wpa-psk</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">nmcli con modify <i>ConnectionName</i> wifi-sec.psk <i>verysecurepassword</i></span><br />
<br />
Now you can bring up the connection:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">nmcli con up ConnectionName</span><br />
<br />
<h2>
Conclusion</h2>
Here we have an headless and wireless Raspberry Pi 3 running our favorite GNU/Linux distribution! <br />
<br />
Please refer to the Fedora Project wiki for more and up to date informations:<br />
<a href="https://fedoraproject.org/wiki/Raspberry_Pi">https://fedoraproject.org/wiki/Raspberry_Pi </a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-51614819797680536662017-05-23T21:20:00.000+02:002017-05-23T21:20:25.912+02:00How to print ZFS filesystems ordered by space usedHow to print ZFS filesystems ordered by space used<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">zfs get -o value,name -Hp used|sort -n</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-47141217550122743662017-05-20T07:56:00.002+02:002017-05-20T07:56:29.532+02:00rpmbuild random notes<span style="font-family: Courier New, Courier, monospace;">sudo dnf install rpmdevtools</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">rpmdev-setuptree</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">~/rpmbuild/SRPMS/</span><br />
<span style="font-family: Courier New, Courier, monospace;">~/rpmbuild/SPECS/</span><div>
<span style="font-family: Courier New, Courier, monospace;">~/rpmbuild/SOURCES/</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">~/rpmbuild/RPMS/</span></div>
<span style="font-family: Courier New, Courier, monospace;">~/rpmbuild/BUILD/</span><div>
<span style="font-family: Courier New, Courier, monospace;">~/.rpmmacros</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">sudo dnf download --source package</span></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-79902888009425812722017-03-09T21:49:00.000+01:002017-03-09T21:49:08.084+01:00Fedora dnf historySometimes it can happen that you remove a package and inadvertently you remove a bunch of dependencies. Like removing the entire desktop manager: what a mess, waht a pain in the ass!<br />
Sometimes dependecies are strange.<br />
<br />
Rarely, but it can happen too, after an update something doesn't work anymore. Maybe the updated package is buggy? Better waiting for a fix.<br />
<br />
By the way. If you install or uninstall packages by mistake, there is a way to rollback the changes: history.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo dnf history list</span><br />
<br />
And you can see the dnf activities.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo dnf history info 132</span><br />
<br />
You can see the details of the dnf command labeled as 132<br />
<br />
Let's say 132 is the number of the last action<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">ID | Command line | Date and time | Action(s) | Altered</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">-------------------------------------------------------------------------------</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> 132 | update | 2017-03-09 16:06 | Update | 8 </span><br />
<br />
Issue the following command in order to uninstall these updates:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo dnf history undo 132</span><br />
<br />
And you will get something like:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Undoing transaction 132, from Thu Mar 9 21:06:10 2017</span><br />
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">No package libgdata-0:0.17.6-3.fc25.x86_64 available.</span></div>
</div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Error: An operation cannot be undone</span></div>
</div>
<div>
<br /></div>
<div>
Well. WTF!</div>
<div>
<br /></div>
<div>
It seems that, if you would like to have the option to rollback updates, you must enable packages cache beforehand with <span style="font-family: Courier New, Courier, monospace;">keepcache=1</span> in the<span style="font-family: Courier New, Courier, monospace;"> /etc/dnf/dnf.conf</span> configuration file. This could lead to some disk space used to store previous versions of rpms? I must investigate a bit deeper.</div>
<div>
<br /></div>
<div>
References: </div>
<div>
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1218403">https://bugzilla.redhat.com/show_bug.cgi?id=1218403</a></div>
<div>
<a href="https://docs.fedoraproject.org/en-US/Fedora/25/html/System_Administrators_Guide/sec-DNF-Transaction_History.html">https://docs.fedoraproject.org/en-US/Fedora/25/html/System_Administrators_Guide/sec-DNF-Transaction_History.html</a></div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-80648033325733221442017-03-06T21:40:00.000+01:002017-03-06T21:40:14.187+01:00Get the most out of GNOME notifications<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-BC6RaaeIh5o/WL08zXI0jCI/AAAAAAAAB2o/p4p5fJHRJqovhe6ViV9uDGKrnlVyXSlTgCLcB/s1600/gnome-notifications-945x400.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="168" src="https://1.bp.blogspot.com/-BC6RaaeIh5o/WL08zXI0jCI/AAAAAAAAB2o/p4p5fJHRJqovhe6ViV9uDGKrnlVyXSlTgCLcB/s400/gnome-notifications-945x400.png" width="400" /></a></div>
<br />
<br />
Learn how to get more out of your GNOME notifications on Fedora Workstation.<br />
My first article on Fedora Magazine.<br />
<div>
<br /></div>
<a href="https://fedoramagazine.org/get-gnome-notifications/">https://fedoramagazine.org/get-gnome-notifications/</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-55588783315682119942017-02-21T06:18:00.000+01:002017-02-21T06:18:14.680+01:00Oracle Database Appliance: random notes<h2>
How to create a shared repository</h2>
<span style="font-family: "courier new" , "courier" , monospace;">[root@oda11 ~]# oakcli create repo shared1 -dg data -size 50G</span><br />
<h2>
How to import a VM template</h2>
You must/can download a template from edelivery.oracle.com<br />
You need to put the template or the assemly inside the DOM0, then import it from ODA_BASE.<br />
<span style="font-family: "courier new", courier, monospace;">[root@oda11 ~]# oakcli import vmtemplate prova -assembly /tmp/OVM_OL7U2_x86_64_PVHVM.ova -repo shared1 -node 0</span><br />
<h2>
How to create a VM</h2>
<span style="font-family: "courier new" , "courier" , monospace;">[root@oda11 ~]# oakcli clone vm pigna -vmtemplate prova -repo shared1 -node 0</span><br />
<h2>
How to create a vdisk</h2>
A vdisk that will be attacched to the VM<br />
<div>
<span style="font-family: "courier new", courier, monospace;">[root@oda11 ~]# oakcli create vdisk pignadiskl -repo shared1 -size 5G -type local</span><br />
<h2>
How to create a cpupool</h2>
</div>
<div>
The same pool name must be configured on each node.</div>
<div>
<span style="font-family: "courier new", courier, monospace;">[root@oda12 ~]# oakcli create cpupool provapool -numcpu 2 -node 1</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">[root@oda12 ~]# oakcli create cpupool provapool -numcpu 2 -node 0</span></div>
<h2>
How to configure the VM</h2>
<h3>
Add two network interfaces</h3>
<span style="font-family: "courier new" , "courier" , monospace;">[root@oda11 ~]# oakcli configure vm pigna -network "['type=netfront,bridge=net1','type=netfront,bridge=net2']"</span><br />
<h3>
Enable failover</h3>
[root@oda11 ~]# oakcli configure vm pigna -failover true<br />
<h3>
Attach an additional disk</h3>
<span style="font-family: "courier new" , "courier" , monospace;">[root@oda11 ~]# oakcli modify vm pigna -attachvdisk pignadiskl</span><br />
<h3>
Configuring cpupool</h3>
<span style="font-family: "courier new" , "courier" , monospace;">[root@oda11 ~]# oakcli configure vm pigna -cpupool provapool</span><br />
<h2>
Starting the VM</h2>
<span style="font-family: "courier new" , "courier" , monospace;">[root@oda11 ~]# oakcli start vm pigna</span><br />
<h3>
Attacching to the console</h3>
You must ssh to the ODA_BASE using <span style="font-family: Courier New, Courier, monospace;">-Y</span> flag.<br />
<span style="font-family: "courier new", courier, monospace;">[root@oda11 ~]# oakcli show vmconsole pigna</span><br />
A VNC session will start<br />
<h2>
Expanding the disk space from inside the VM</h2>
This is the vdisk created before.<br />
<div>
<span style="font-family: "courier new", courier, monospace;">[root@pigna ~]# btrfs device add /dev/xvdb /</span></div>
You can attach additional vdisks, and the VM OS will see them without the need to reboot it.<br />
<h2>
Adding space to the repo</h2>
<span style="font-family: Courier New, Courier, monospace;">[root@oda11 ~]# oakcli configure repo shared1 -incsize 25G</span><br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-71491060961925683032016-12-12T21:26:00.000+01:002016-12-12T21:26:02.224+01:00Percona Monitoring Plugins for Nagios on SmartOSUsing Percona monitoring plugins inside a SmartOS branded zone, I get an error related to the local command.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">percona-monitoring-plugins-1.1.7/nagios/bin/pmp-check-mysql-innodb[58]: <b>local: not found [No such file or directory]</b></span><br />
<div>
<br /></div>
<div>
To solve this problem, perform the following command against every script (i.e. inside the <span style="font-family: Courier New, Courier, monospace;">nagios/bin/</span> directory).</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">sed -i 's/^\( \{2,4\}\)local /\1typeset /' *</span></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-36743023889339518632016-11-28T21:03:00.000+01:002016-11-28T21:03:02.987+01:00rsyslog gnutls: could not load moduleStarting rsyslog with gnutls configured I got this error:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Nov 27 21:57:03 prometeo rsyslogd-2068: could not load module '/usr/lib64/rsyslog/lmnsd_gtls.so', rsyslog error -2078 [try http://www.rsyslog.com/e/2068 ]</span><br />
<br />
The suggested link is not useful as the description (module could not be loaded - init failed) is too generic.<br />
<br />
The problem here was that in the config file, the line <span style="font-family: Courier New, Courier, monospace;">DefaultNetstreamDriverCAFile</span> was pointing to a non existent file.<br />
<div>
<br /></div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-15739255669400454142016-06-15T20:04:00.000+02:002016-06-15T20:04:08.539+02:00We're sorry to see you go<br />
We're sorry to see you go<br />
Your LinkedIn account is now closed. Although you no longer have access to it, it'll take a few weeks for your public profile to disappear from search engines.<br />
You may still receive invitations from LinkedIn members and groups.<br />
Thanks,<br />
The LinkedIn TeamUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-37336491997905157842016-04-16T02:42:00.000+02:002016-04-16T02:42:25.945+02:00Giochini elettrificati<span style="font-family: inherit;">Per i lettori italiani.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Ho messo in piedi un <i>sito vetrina</i> dove condivido le mie creazioni elettroniche.</span><br />
<span style="font-family: inherit;">Oggetti altamente artigianali e dilettanteschi. Talvolta brutti e fatti male.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><a href="https://www.gioele.xyz/" target="_blank">https://www.gioele.xyz</a></span><br />
<br />
<span style="background-color: white; color: #333333; font-family: inherit; font-size: 16px; line-height: 22.4px;">In questo sito raccolgo e presento qualche idea e qualche realizzazione, spesso maldestramente scopiazzate, di semplici e molto artigianali oggetti elettronici fatti in casa (circuiti e roba basata su Arduino) con cui far divertire in qualche modo bambine e bambini.</span><br />
<span style="background-color: white; color: #333333; font-family: inherit; font-size: 16px; line-height: 22.4px;">E magari, perché no, stimolare la loro curiosità nei confronti di hacking, DIY, elettronica e informatica.</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-15056779920666097852016-03-24T21:56:00.000+01:002016-04-22T14:16:45.005+02:00Arduino IDE and persistent serial port (Linux)In the development of a little project with Arduino, I have to plug and unplug the USB cable a lot of times.<br />
And I have a big annoyance: every time I plug the USB cable again, the port name changes from /dev/ttyUSB0 to /dev/ttyUSB1 and vice versa. So, in the IDE I have to go in Tools -> Port menu and select the right serial port every time before uploading the new sketch.<br />
What a bore!<br />
<br />
I've found <a href="http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/" target="_blank">this post</a>, but the Arduino IDE seems that doesn't detect fancy names like /dev/arduino, but only names starting with "tty".<br />
<br />
So my solution, in order to get a persistent name, is based on the http://hintshop.ludvig.co.nz/ blog post, but using a different port name:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo vi /etc/udev/rules.d/98-usb-serial.rules</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="ttyUSB10"</span><br />
<br />
Reload udev rules with:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo udevadm control --reload-rules -R</span><br />
<br />
Now in the IDE you can select this port and it never change every time you unplug and plug the USB cable.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-18136493579755313462016-03-14T21:04:00.000+01:002016-03-14T21:04:02.308+01:00OMD: python problem after CentOS yum updateAfter yum update I got a problem, related to python, with check_mk in the <a href="http://omdistro.org/" target="_blank">OMD</a> implementation.<br />
<br />
Environment:<br />
<br />
<ul>
<li>CentOS 7</li>
<li>check_mk 1.2.4p5</li>
<li>omd-1.20</li>
</ul>
<br />
<br />
In the check_mk web page you can see a lot of messages like this in each "Check_MK inventory" check.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>(Return code of 5 is out of bounds)</b></span><br />
<br />
and if you issue the <span style="font-family: Courier New, Courier, monospace;">check_mk</span> command you get<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>Cannot read file /omd/sites/prod/share/check_mk/modules/check_mk_base.py: 'frozenset' object is not callable</b></span><br />
<div>
<br /></div>
<div>
My solution was:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">cp /omd/versions/1.20/lib/python/hashlib.py /omd/versions/1.20/lib/python/hashlib.py.OLD</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">cp /usr/lib64/python2.7/hashlib.py /omd/versions/1.20/lib/python/hashlib.py</span></div>
</div>
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-8009822662942276789.post-42992486380063686482016-03-10T20:29:00.000+01:002016-03-10T20:29:01.282+01:00Codermachine: insegnamento della programmazione ai bambini, the proletarian wayFor Italian readers.<br />
<br />
<a href="http://codermachine.lumacaonline.org/">http://codermachine.lumacaonline.org/</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-hgmyo_LG_Rk/VuGgx3MVEuI/AAAAAAAAA88/0nzjiVchBas/s1600/Scanne001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://3.bp.blogspot.com/-hgmyo_LG_Rk/VuGgx3MVEuI/AAAAAAAAA88/0nzjiVchBas/s320/Scanne001.png" width="320" /></a></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-23346429830911476452016-03-10T17:23:00.000+01:002016-03-10T17:23:51.343+01:00falcao.js slideshare<iframe allowfullscreen="" frameborder="0" height="485" marginheight="0" marginwidth="0" scrolling="no" src="//www.slideshare.net/slideshow/embed_code/key/EFk4ufuwQkJbJq" style="border-width: 1px; border: 1px solid #ccc; margin-bottom: 5px; max-width: 100%;" width="595"> </iframe> <br />
<div style="margin-bottom: 5px;">
<br /></div>
<a href="https://github.com/alcir/falcao.js">https://github.com/alcir/falcao.js</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-78150125763620140642016-02-10T21:19:00.000+01:002016-02-10T21:19:02.780+01:00SmartOS: how to clone a KVM machineGet the disk0 filesystem of the VM to clone.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">vmadm get <i>uuid-originvm</i> | json disks</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">[</span><br />
<span style="font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "path": "/dev/zvol/rdsk/zones/<i>uuid-originvm</i>-disk0",</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "boot": true,</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "model": "virtio",</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "media": "disk",</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "image_size": 10240,</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "image_uuid": "d8e65ea2-1f3e-11e5-8557-6b43e0a88b38",</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "zfs_filesystem": "zones/<i>uuid-originvm</i>-disk0",</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "zpool": "zones",</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "size": 10240,</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "compression": "off",</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "refreservation": 10240,</span><br />
<span style="font-family: Courier New, Courier, monospace;"> "block_size": 8192</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;">]</span><br />
<div>
<br /></div>
<div>
Take a snapshot<br />
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">zfs snapshot zones/<i>uuid-originvm</i>-disk0@toclone</span></div>
<div>
<br /></div>
<div>
Create a json file in order to create the new VM.<br />
<span style="font-family: Courier New, Courier, monospace;">vi targetvm.json</span><br />
Please note: there are no disks.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">{</span></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "alias": "targetvm",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "hostname": "targetvm",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "dns_domain": "mydomain.it",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "brand": "kvm",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "resolvers": [</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "192.168.0.2"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> ],</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "ram": "2048",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "vcpus": "2",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "nics": [</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> {</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "nic_tag": "admin",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "ip": "192.168.0.201",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "netmask": "255.255.255.0",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "gateway": "192.168.0.1",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "model": "virtio",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "primary": true</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> }</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> ]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">}</span></div>
</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">vmadm create -f targetvm.json</span></div>
<div>
<br /></div>
<div>
<div>
Let's clone the filesystem of the <i>origin</i> VM.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">zfs clone zones/<i>uuid-originvm</i>-disk0@toclone zones/<i>uuid-targetvm</i>-disk0</span></div>
</div>
<div>
<br />
Create a json in order to add a disk to the new VM.<br />
<span style="font-family: Courier New, Courier, monospace;">vi adddisk.json</span><br />
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">{</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "add_disks": [</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> {</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "media": "disk",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "model": "virtio",</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "boot": true,</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "nocreate": true,</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "size": 10240,</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> "path": "/dev/zvol/rdsk/zones/435ca788-4935-ead3-f4e4-94e6eb7dd4b6-disk0"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> }</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> ]</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">}</span></div>
</div>
<div>
<br /></div>
<div>
Let's add the disk to the newly created VM.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">vmadm stop <i>uuid-targetvm</i> -F</span></div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">vmadm update <i>uuid-targetvm</i> -f adddisk.json</span></div>
<div>
<br /></div>
<div>
This is important.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">zfs promote zones/<i>uuid-targetvm</i>-disk0</span></div>
<div>
<br /></div>
<div>
<div>
From <span style="font-family: Courier New, Courier, monospace;">man zfs</span>:</div>
<div>
<br /></div>
<div>
<i>zfs promote clone-filesystem</i></div>
<div>
<i><br /></i></div>
<div>
<i> Promotes a clone file system to no longer be dependent on its "ori-</i></div>
<div>
<i> gin" snapshot. This makes it possible to destroy the file system</i></div>
<div>
<i> that the clone was created from. The clone parent-child dependency</i></div>
<div>
<i> relationship is reversed, so that the origin file system becomes a</i></div>
<div>
<i> clone of the specified file system.</i></div>
<div>
<i><br /></i></div>
<div>
<i> The snapshot that was cloned, and any snapshots previous to this</i></div>
<div>
<i> snapshot, are now owned by the promoted clone. The space they use</i></div>
<div>
<i> moves from the origin file system to the promoted clone, so enough</i></div>
<div>
<i> space must be available to accommodate these snapshots. No new</i></div>
<div>
<i> space is consumed by this operation, but the space accounting is</i></div>
<div>
<i> adjusted. The promoted clone must not have any conflicting snapshot</i></div>
<div>
<i> names of its own. The rename subcommand can be used to rename any</i></div>
<div>
<i> conflicting snapshots.</i></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-56665135455849543092016-01-19T21:03:00.000+01:002016-01-19T21:03:05.222+01:00mod_jk apache 2.4 smartos zoneIf, compiling mod_jk, you get<br />
<br />
/usr/bin/bash: ../build/libtool: No such file or directory<br />
<div>
<br /></div>
Then<br />
<br />
cd native/<br />
./configure --with-apxs=/opt/local/bin/apxs<br />
mkdir build<br />
cp libtool build/<br />
make<br />
cp ./apache-2.0/mod_jk.so /opt/local/lib/httpd/<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-20696983565978755402016-01-15T21:30:00.000+01:002016-01-19T16:58:34.764+01:00tomcat sloooow to start, smartos, kvm: urandom?A fresh installation of CentOS 7 in a SmartOS KVM virtual machine using a dataset ( image_uuid: d8e65ea2-1f3e-11e5-8557-6b43e0a88b38).<br />
CentOS updated just after the installation.<br />
<br />
<br />
<ul>
<li>apache-tomcat-7.0.64</li>
<li>Java(TM) SE Runtime Environment (build 1.7.0_80-b15)</li>
</ul>
<br />
<br />
<div>
I noticed that Tomcat, at startup was very very very, help me, very slow to start.</div>
<div>
I used strace to look at what was happening (even if I don't understand anything).</div>
<div>
<br /></div>
<div>
I got a lot of</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">[pid 1279] futex(0x7f5a880a7154, FUTEX_WAIT_BITSET_PRIVATE, 1, {348, 455527976}, ffffffff) = -1 ETIMEDOUT (Connection timed out)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">[pid 1279] futex(0x7f5a880a7128, FUTEX_WAKE_PRIVATE, 1) = 0</span></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Just googled around. I found something similar.</div>
<div>
<br /></div>
<div>
So the solution is: to add the following option to java in the tomcat startup script<br />
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><b>-Djava.security.egd=file:/dev/urandom</b></span></div>
<div>
<br />
(like <span style="font-family: "courier new" , "courier" , monospace;">CATALINA_OPTS="$CATALINA_OPTS -Djava.security.egd=file:/dev/./urandom"</span>).</div>
<div>
<br /></div>
<div>
Who knows?</div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-11488127568203305582015-09-23T21:57:00.000+02:002015-09-23T21:57:00.156+02:00elasticsearch, reindex using logstashWell, I'm not an elasticsearch expert, not at all. And, as usual, my english sucks.<br />
<br />
Let's say that you have indexed a bunch of stuff, and now you need to change an index type.<br />
For instance, in my case, I've seen that a filed named "hostname" was splitted if it was containing a dash, like "tc-pi.pacs.mydomain" was splitted in two parts when creating graphs using kibana.<br />
The solution, in order to avoid this hostname splitting, is to define <span style="font-family: Courier New, Courier, monospace;">"index" : "not_analyzed"</span> in logstash mapping.<br />
<br />
Well, reading around it is not possible to change mappings once the document were indexed.<br />
<br />
So a solution, a workaround, thanks to <a href="http://david.pilato.fr/blog/2015/05/20/reindex-elasticsearch-with-logstash/" target="_blank">this post</a> is the following.<br />
<br />
"Download" the old index<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">curl -XGET 'http://127.0.0.1:9200/dcmaudit/_mappings/'</span><br />
<br />
Copy the result in a text editor for your convenience, then change the mapping, like<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">...</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">"hostname":{"type":"string", </span><b style="font-family: 'Courier New', Courier, monospace;">"index" : "not_analyzed"</b><span style="font-family: 'Courier New', Courier, monospace;">}</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">...</span><br />
<br />
Create a new index:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">curl -XPOST http://localhost:9200/<b>dcmaudit2</b> -d '{"mappings":{"logs":{"properties":{"@timestamp":{"type":"date","format":"dateOptionalTime"},"@version":{"type":"string"},"ParticipantObjectIdentification2.ParticipantObjectTypeCode.displayName":{"type":"string", "index" : "not_analyzed"},"hostname":{"type":"string", "index" : "not_analyzed"},"message":{"type":"string"},"tags":{"type":"string"},"timestamp":{"type":"date","format":"dateOptionalTime"}}}}}'</span><br />
<br />
Now let's create a logstash configuration file like this:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">input {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> # We read from the "old" index</span><br />
<span style="font-family: Courier New, Courier, monospace;"> elasticsearch {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> hosts => [ "localhost" ]</span><br />
<span style="font-family: Courier New, Courier, monospace;"> port => "9200"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> index => "<b>dcmaudit</b>"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> size => 500</span><br />
<span style="font-family: Courier New, Courier, monospace;"> scroll => "5m"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> docinfo => true</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">filter {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> mutate {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> remove_field => [ "@timestamp", "@version" ]</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">output {</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">elasticsearch {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> host => "localhost"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> port => "9200"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> protocol => "http"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> index => "<b>dcmaudit2</b>"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> index_type => "%{[@metadata][_type]}"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> document_id => "%{[@metadata][_id]}"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> stdout {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> codec => rubydebug</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<br />
Launch logstash<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">./bin/logstash -f conf.json</span><br />
<br />
Now all the stuff from one index (<b>dcmaudit</b>) will be copied to the new one (<b>dcmaudit2</b>).<br />
<br />
At this point you can delete the old index.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">curl -XDELETE localhost:9200/dcmaudit</span><br />
<br />
If you want, and if you need it, you can run this task again, recreating the old index name (dcmaudit) but whit the new mapping, and then repeat the logstash task changing the input and the output <span style="font-family: 'Courier New', Courier, monospace;">index </span>accordingly.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-5709540434511884242015-08-26T21:04:00.000+02:002015-08-26T21:04:00.044+02:00Oracle Java, SmartOS Centos 6 LX branded zone: error while loading shared libraries libjli.soSmartOS 20150820T062742Z<br />
<br />
centos-6 lx-dataset image_uuid b1e082f6-460d-11e5-991a-0bc7df451392 (version 20150819)<br />
<br />
I don't know if this happens in other versions or linux distributions.<br />
<br />
I've installed Java (using the tar.gz archive downloaded from Oracle). Java 6 and Java 7: same issue.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">/usr/java/latest/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory</span><br />
<div>
<br /></div>
<div>
Weird:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-size: xx-small;"> # <span style="font-family: Courier New, Courier, monospace;">ldd /usr/java/latest/bin/java</span></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>lx_vdso.so.1 => (0x00007fffff0b0000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffffee00000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>libjli.so => /usr/java/latest/bin/../lib/amd64/jli/libjli.so (0x00007ffffecf5000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>libdl.so.2 => /lib64/libdl.so.2 (0x00007ffffea00000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>libc.so.6 => /lib64/libc.so.6 (0x00007ffffe600000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/lib64/ld-linux-x86-64.so.2 (0x00007fffff200000)</span></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Solution:</b></div>
<div>
<br /></div>
<div>
Create the file <span style="font-family: Courier New, Courier, monospace;">/etc/ld.so.conf.d/java.conf</span> and put the following line in it</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">/usr/java/latest/lib/amd64/jli/</span></div>
</div>
<div>
<br /></div>
<div>
Then run the <span style="font-family: Courier New, Courier, monospace;">/sbin/ldconfig</span> command.</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"># /usr/java/latest/bin/java -version</span></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">java version "1.6.0_65"</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Java(TM) SE Runtime Environment (build 1.6.0_65-b32)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04, mixed mode)</span></div>
</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"># ldd /usr/java/latest/bin/java </span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>lx_vdso.so.1 => (0x00007fffff0b0000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffffee00000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>libjli.so => /usr/java/latest/bin/../lib/amd64/jli/libjli.so (0x00007ffffecf5000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>libdl.so.2 => /lib64/libdl.so.2 (0x00007ffffea00000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>libc.so.6 => /lib64/libc.so.6 (0x00007ffffe600000)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/lib64/ld-linux-x86-64.so.2 (0x00007fffff200000)</span></div>
</div>
<div>
<br /></div>
Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-8009822662942276789.post-32590307001619680742015-08-20T20:00:00.000+02:002015-08-20T20:00:00.989+02:00How to expand GLPI entity tree sons by default<span style="font-family: Courier New, Courier, monospace;">vi ajax/entitytreesons.php</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">...</span><br />
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> 83 $path['state'] = 'open';</span><br />
<span style="font-family: Courier New, Courier, monospace;">...</span><br />
<span style="font-family: Courier New, Courier, monospace;"></span><br />
<span style="font-family: Courier New, Courier, monospace;">119 $path['state'] = 'open';</span><br />
<div>
...</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8009822662942276789.post-23910001847171920792015-06-30T21:58:00.000+02:002015-06-30T21:58:00.288+02:00Nagios plugin: check oracle queryHere is a Nagios plugin useful to connect to an Oracle database, perform a query and check the result by a regular expression.<br />
<br />
Please note: it works for me, but <span class="short_text" id="result_box" lang="en"><span class="">it is</span> <span class="hps">far from perfect</span></span>. <br />
<br />
<a href="https://github.com/alcir/nagios/tree/master/check_oracle_query">https://github.com/alcir/nagios/tree/master/check_oracle_query</a><br />
<br />
Examples<br />
<br />
<code>./check_oracle_query.sh -H 192.168.1.10 -u user -w pass -p 1521
-s SID -n ID -q "select * from table" -e "^[1-9].* rows selected"</code><br />
<br />
<code>./check_oracle_query.sh -H 10.0.0.47 -u user -w pass -p 1521 -s SID01 -n ID1 -q "select * from dual" -e "^X"</code>Unknownnoreply@blogger.com0