HP 18020-24G J9980A enable SNMP

We recently bought a new switch -yeeeey-  (b/c the old one broke and nobody had access to it -no yeey-). The model is a HP 18020-24G J9980A. It really works fine, but It had SNMP disabled by default. I only found references to older models that did not support SNMP or not nicely. I’m just starting with SNMP so I only need read access. You can find it under Setup Network  -> Get Connected.

resize usb stick broken due to dd

My USB device (8Gb), I used to install a Linux distro on, (as a platform to start installation on a server). Was kinda messed up… Instead of giving 8Gb, it was showing ~300mb and refusing to format in Windows. Even in linux parted and fdisk did not show the right size, combined with allot of errors.

I was able to solve this re-sizing using BOOTICE, I found how on this page.  Notice the Linux method there was not working in my case.

Hope this helps some people desperately searching for a solution.

Download a list of files

Downloading ~150 links in a text file, sounds like a horror show, right ? Not really ! The wget application in any linux distro will help you out.

wget -i file_with_downloads

Since my links where coming from one source, wget told me it was  “reusing the connection” (keep-alive ?) After some time however the server on the other side decided I had downloaded more then enough and killed some of the connections, so some files where not downloaded. Now the problem even got worse, since I had to check if wget had downloaded them or not. There might be an easier solution, but I took my best bash from the closet and came up with :

while read p; do
  FILE=`echo $p | cut -c44-100`
  if [ -f $FILE ];
  then
    echo "echo OK"
  else
    echo "downloading $FILE"
    wget $p &
  fi;
done <download_list

This started some 10 wgets simultaneously, which is not all that great, but it worked. Probably some better ways exists to tackle this problem, but if it works it works! 🙂

happy downloading.

notice : the cut -c44-100 actually cuts off the base url, this will be different from what you download. (unless your downloading the same files, highly unlikely)

You found a bug in GNU Parted!

Heyho, I was not looking for a bug tho, so that’s bad news 😀

You found a bug in GNU Parted! Here's what you have to do:
...
Assertion (bs != NULL) at ../../../../libparted/fs/fat/bootsector.c:282 in

As any bad user, I stopt reading there, to see what the internet had to say about this. Seems it was reported already (and solved!) so I was off the hook! However I tend to update&upgrade this system rather regular and somewhere I recalled I even installed an “auto updater” (unattended-upgrades, -redhat- yum-cron). So I knew my repo was not up-to-date with this release, I could wait for it, but I need this disk formatted right now. Since parted is open-source software, one can simply download the source and compile them self. (download from gnu.org)   This machine is debian based,

svenn@work:~/parted-3.0$ cat /etc/debian_version
jessie/sid

(I have no idea what distribution, terminal is my GUI for this machine)

After a few attempts to compile I started collecting dependency’s I did not have, so feel free to check if you have them before starting 🙂

sudo apt-get install uuid-dev libdevmapper-dev libncursesw5-dev libghc-readline-dev

I originally took parted 3.0.0 since it had a .tar.gz extension, that I know how to uncompress (tar xvf file.tar.gz) the latest version was .tar.xz so I thought it was to much bother to find a method… (tar xvgJ file.tar.xz) so I got this result for my laziness : (#overly_honest)

  CC       freading.lo
In file included from freading.h:18:0,
                 from freading.c:20:
./stdio.h:1050:1: error: 'gets' undeclared here (not in a function)
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

So I downloaded the 3.2.0 version (latest at time of writing), uncompressed and compiled. (./configure && make && make install)  At-least this compiled and worked as expected, however the binary’s “parted” now throw an error :

parted: error while loading shared libraries: libparted.so.2: cannot open shared object file: No such file or directory

So seemingly it does not find some library … it probably means something is not there or not in the right place. However the /home/compile_dir/parted/parted binary just works oke, so I when with this version. As removing parted from the distribution was going remove allot dependency’s I’m not sure I want to throw away just yet …

Now on to the formatting of fat32 ! 🙂

Favicon compression

While checking speed using webpagetest.org of juridischforum.be, I noticed the favicon I created was 97,3 kB large. Now that “only” contributes to 386ms load time (62ms initial, 72ms ttfb and 252ms content download).  I thought that was pretty oké, until I checked out yet another service that checks common speed issues. (zoompf) Generally I distrust commercial products as they always claim to make your server run 10x as fast if you just buy there product.  Similar numbers popped out of the free result : The favicon could be compressed and up to 91% “faster”.

So I googled around and found a nice article, but sadly its for Mac claiming up to 60% smaller file size without sacrificing quality. Lucky for my wallet, I don’t own a Mac and the suggested tools don’t work with windows all that well. So I tried favicon.cc to upload and “auto create” an ico. The result was acceptable and the download of my favicon was only 1,12 kB large anymore !

Now I started jumping around. With some more googling however, I found that the original large .ico is in fact a container for multiple images (in my case 5) that will be picked by the browser depending on what the browser likes best. (cheat sheet on favicons)

So back to zero ? Not really, in my hunt to find a service that could make compressed ico’s for me I found favicomatic. A great service that picks up my original png file (5,64 kB) and makes all kinds of formats. (including the code I have to copy & paste!)

[table]
file,size
apple-touch-icon-57×57.png,4kb
apple-touch-icon-72×72.png,4kb
apple-touch-icon-114×114.png,10kb
apple-touch-icon-120×120.png,6kb
apple-touch-icon-144×144.png,8kb
apple-touch-icon-152×152.png,15kb
favicon.ico,6kb
favicon-16×16.png, 1kb
favicon-32×32.png, 2kb
mstile-144×144.png, 8kb[/table]

While allot more then the favicon.cc’s 1,12 kB still a reduction from 97,3 kB (note: not all of them get downloaded, just the one the browser likes best)!

Now kB’s don’t say much when you don’t know how much ms’s I just shaved off.

[table]
type,before,after
download,97.6 KB, 0.8 KB
time,252 ms, –
[/table]
Using webpagetest.org, who selected favicon-16×16.png. As seen in the table, the ms is not given, considering (97,6/252) x 0,8 =~ 0.3 ms it seems that the download time is trivial <1ms and as such is not given. (from the Brussels datacenter of webpagetest, the website is located on an Amsterdam datacenter)

Discussion

Favicons are the tiny little things in the browser, that get loaded when you visit a site, they also show up in front of the bookmark. So its useful to set up a nice one. While digging I found that the ico I used was rather large, and that is not really needed. So I down scaled it using different services, of which I liked favicomatic.com the most.

While checking how much speed I had gained, I noticed that google’s builtin development tools (control-shift-I) din’t show favicon.ico. So I  cannot reliably say how much speed I have gained, if I even have gained speed, as ico’s generally get downloaded only once, and I had to add html code to support multiple files for Apple devices and w10’s edge browser.

The webpagetest.org however gives me a better score and in no way 3 lines of html equal 97kB of ico. So I think I made some gain, I doubt users will notice the 250ms difference, but on a bad server day it might make some difference ! The key to a faster website obviously is in tiny steps!

eps in inkscape @ windows 10

Loading a .eps file in inkscape on windows, is a real pain, I told a colleague, that can’t be, its a vector format, should be easy-peasy. The reality of it is however; its not as straightforward as expected. You need a 3th party application installed and put in the environment variable of windows. While for any Linux rookie this is nothing special,  for Windows people, this seems like allot of work. Since those same windows people like images and buttons, this excellent article guides you how to do it :

http://clownfishcafe.blogspot.be/2014/05/importing-eps-files-into-inkscape.html

Confirmed to still work on windows 10, 32bit.

Fatal error: Call to undefined function ibase_connect() PHPFatal error: Call to undefined function ibase_connect()

Ouch, while trying to connect to a firebird database (I know its not popular)

Fatal error: Call to undefined function ibase_connect()

The solution for me was simple, the module was not installed ! Since I work with centos, I have a alternative repo (as the official one doesn’t have newer versions of PHP)

yum install php55w-interbase
service httpd restart

Restarting httpd and fixed !

mirror a full ftp

Downloading a full ftp, with tons of small files can be allot of click work, so generally users ship it of to IT/BioIT  . When downloading from a ftp, you cannot use rsync -sadly-. As such, we need other solutions, lucky -for me- wget just is the tool we need.

wget -m --ask-password ftp://user@IP_ADDDR:/dir/to/download

Starting this in a GNU screen and voila time for :

source