Thursday 8 October 2020

Dell T1600 cheap home server

My home server needs

All the stuff on the laptop is great, but sometimes I need something with a little bit more power (not Dual core but Quad-Core and more RAM), also I'd like to have something always running and available (dockers for example) and that's not doable with laptops.  

So my requirements would be quad-core, expansible RAM up to 32gb, GPU expandable, SILENT, CHEAP, and CHEAP. After some time browsing the net I've found a Dell T1600 for 50$ !!!

Dell T1600 home server specs

So for 50$ (plus shipping) what does one get? E3-1225 CPU (quad-core 4threads and GPU integrated), 4GB Ram (1066Mhz Dual Channel), GPU NVIDIA Quadro2000, PUS 320W 90%Power Efficient, 500GB HDD and a not so pretty chassis (but will be hidden so no issue here).
The CPU and Chassis fan (on the back below the PSU) are very quite by default so at present time no need to change them.
dell t1600
T1600 chassis

dell t1600
2 HDD Bays ready to get SSD on it!

Upgrades to T1600

What stays what goes and what to enhance? 
  • Clean it properly, blow out all the dust, clean the fans
  • CD-ROM disconnected, don't need it, less noise, less stuff, SATA and power cables out, yet it's still there until I get front bay cover. (if ever!)
  • 500GB HDD Swap for an SSD, my pick was a 480GB lower brand SSD laying around, had to get a 3.5 to 2.5 cage converter to fit the blue brackets.
  • Change thermal paste! This is critical, don't know for how long (if ever!) the thermal compound has been changed and this is a 95w CPU so it will get HOT. Used the Grizzly  Kryonaut.
  • The NVIDIA Quadro 2000 is OK, but for projects which use CPU/CUDA cores (and maybe some light gaming) swapped it for an MSI AERO TI 1050 . This GPU is small form designed for ITX, not that's needed, and will get all the power from the PCI-E slot. Notice dell T1600 PSU DOES NOT HAVE GPU connector. Also this new GPU has HDMI output which is a lot easier to use than caring and using DVI adapters.
  • RAM 2*2gb 1066Mhz, used some dimms from friends and got it 2*2 + 4*4  (1333Mhz)= 12gb in dual channel. Still at 1066 which will change soon to 1333Mhz on all the dimms

To do Upgrades to Dell T1600 

  • RAM from 12gb to 16gb or 24 or 32 all 1333Mhz. Specs say 16gb RAM tops but has been proved that it will take up to 32gb ram
  • Upgrade CPU to 4core 8thread E3-1270 or 1280. These ones have double the E3-1225 threads, have higher MHZ and lower TWP (80watts) since they do not have an integrated GPU.

Drawbacks and limitations of the Dell T1600 you should know

  • PSU's ( 265W or 320W) don't have a GPU power connector. So with standard PSU you're limited to PCI-E powered GPU's. Note also that the 320W PSU won't be enough for mid-range GPUs 
  • CPU fan connector, and case connectors are DELL proprietary. If you plan to change the default fans you'll need and an PWM 5 to 4 pin adapter, like this one here again the fans by default are quite enough.

What happened to my Dell T1600

I's alive and kicking! Handles full load for 2/3hours without throttling and with reasonable temperatures 62 Degrees Celcius full load (for this CPU and keep in mind it's on tight space). The CPU also handles high loads pretty well AND VERY SILENTLY! It has been always on, a true workhorse. I actually also started to play some games (new games not 90's graphic games) on it remotely and it's still very capable being the GPU the bottleneck.

Update 10-2020:

Due to powerline low bandwithd added an PCI-E wifi card, TP-LINK Archer T4E which speeded up by 2 (yes TWO double speed). Internet speed a lot faster and I can play with Parsec remotley at home even better due to low lag. 

Update 11-2021:

Swapped it ! Got an (offered) Lenovo m92p SFF and had to swap the Dell for it. This one is a newer generation and it's more compact. (downgrading on the GPU though).

Wednesday 7 October 2020

Python Static Code Analysis

Python static code analysis with Prospector and Bandit

Not going to talk about the "why should one use code analysis tools", if you read it up to the end you'll get it!

Which code analysis tools?

Let's talk about Code Analysis in Python, what to use, why to use, experience on using it.

Currently I use only 2, and for me it's the limit of code analysis tools to use at the same time without much overhead.  Prospector & Bandit. Why two?

Well one, Bandit,  focus specifically on security on your Python code, the other has a wider range focusing on potential errors, complexity and convention violations . Both overlap in some way, with Prospector replacing Pylint, pep8 and McCabe complexity, endoing: you'll get more than enough code analysis, sometime more than you can handle. (I'll get to that latter on)

 

How to Install Bandit and Prospector?

Installation is very strait forward on both of them.

Installing Bandit is as simple as:

pip install bandit
or 
pip3 install bandit 

Installing Prospector isn't much harder:

pip install prospector[with_everything]
or 
pip3 install prospector[with_everything]

 

Running of Bandit and Prospector?

First you need your python file. In this case I've used an example one just for the sake of example, let's call it tst.py


It's a very simple program with one function, user input and screen output. Let's run first Bandit, how? Simple:

    bandit tst.py

Here's the result:

Looks like we've got a potential issue with the "input" , since we're using python3 won't be a problem but lets assume that it is. Go to the link and read the explanation, so if we're on Python2 let's swap input() with raw_input() else it's all alright.

Now running prospector, the -s flag points the profiles used, from veryhigh to verylow, in here you can opt to choose, if you don't use the flag medium shall be used, for sake of example let's go for the veryhigh :

    prospector -s veryhigh tst.py

 

 

As you can see LOTS of warnings are issued in the veryhigh (30 vs 6 on the medium profile) so use the veryhigh and high with come caution because most of the warnings in veryhigh are related to syntax and indentation aspects (pep8).

So if you apply most of the changes/fix all the warnings how will the code look like? ( DO keep in mind that sometimes you can't actually apply all the changes due to legacy code/ code dependencies, and sometimes your editor my leave some spaces/tabs between the lines which will conflict with the "veryhigh" settings)

Now your code is a bit safer and cleaner. This was a simple and silly example, try to run it on your own scripts/programs and see the differences, again in prospector don't rush into the "veryhigh" profile.

 


Monday 23 December 2019

Speed up apt-get updates

How to speed up apt-get updates?

Apt is the package manager used on Ubuntu and Debian systems, it's been around for a while and it should be around for a lot more, yet it has a problem: it downloads only one package at a time thus making it slow sometimes, specially if you have tons of tinny packages to update.

The solution: apt-fast! Downloads packages in parallel making A LOT faster.

  • How to install
sudo add-apt-repository ppa:apt-fast/stable
sudo apt-get update
sudo apt-get -y install apt-fast
  • How to use it
sudo apt-fast update
sudo apt-fast upgrade
apt-fast
apt-fast installation



That's it!  


Obviously the more packages you're installing/upgrading the more you'll notice the difference.