January 2018

New Category: Shitty Ideas

So I have some ideas from time to time that I tend to forget or deem to crappy to execute.  So I figure I would at least write them down as sometimes the crappy ideas will still bear a fruit of some sort.  Thus I will write them crib note style and password protect them with the password “shitty idea”.  This way they do not get indexed by search engines but still allow the random visitor to view the idea.

Install Dell OpenManage on Ubuntu 16.04 (and up?)

So with this new server I am setting up I wanted to install the Dell OpenManage software but got a headache from doing so. Just about everything I was finding was pointing me to CentOS based info and I am using an Ubuntu based system. Hence my headache. After hours of googling I finally found the page I did and it helped me get Dell OpenManage installed. Of course I had to mangle their instructions some but it was not to bad. Below is what I used and a link to the page that was helpful.

sudo echo 'deb http://linux.dell.com/repo/community/ubuntu trusty openmanage' | sudo tee -a /etc/apt/sources.list.d/linux.dell.com.sources.list
gpg --keyserver hkp://pool.sks-keyservers.net:80 --recv-key 1285491434D8786F ; gpg -a --export 1285491434D8786F | sudo apt-key add -
sudo apt-get update
sudo apt install srvadmin-base srvadmin-storageservices srvadmin-idrac7
# sudo apt install srvadmin-webserver
# sudo service dsm_om_connsvc start && sudo update-rc.d dsm_om_connsvc defaults

Continue reading…

Reducing swap partition on lvm on ubuntu server

So the server I have hosted at Dacentec is starting to show its age and limitations.  Luckily I can get my hands on some decent hardware thanks to ebay and other methods.  So the past few days when time allows I have been working on building a replacement 1u server to what I currently have.  In doing so I am taking the RAM from 16GB to 196GB. With that said the system is installed with a stock ubuntu 17.10 server using guided lvm partitioning.  Which thinks like days of old where total ram equals the swap size needed.

Avoiding the whole debate of how much swap would be ideal. I am just going to scale it back to about 16GB.  Thus freeing up about 80% of the OS RAID 1 drives.

As always google and a stackoverflow/askubuntu (Ref links below) along with some good old fashion thinking.

root@atlas:~# lvs
  LV     VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   atlas-vg -wi-ao----  86.88g                                                    
  swap_1 atlas-vg -wi-ao---- 191.95g                                                    

root@atlas:~# swapoff /dev/atlas-vg/swap_1

root@atlas:~# lvreduce --size 16G /dev/atlas-vg/swap_1
  WARNING: Reducing active logical volume to 16.00 GiB.
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce atlas-vg/swap_1? [y/n]: y
  Size of logical volume atlas-vg/swap_1 changed from 191.95 GiB (49140 extents) to 16.00 GiB (4096 extents).
  Logical volume atlas-vg/swap_1 successfully resized.

root@atlas:~# mkswap /dev/atlas-vg/swap_1
mkswap: /dev/atlas-vg/swap_1: warning: wiping old swap signature.
Setting up swapspace version 1, size = 16 GiB (17179865088 bytes)
no label, UUID=f0260f73-bf13-41d4-af79-3203114b3f9d

root@atlas:~# swapon /dev/atlas-vg/swap_1

root@atlas:~# lvs
  LV     VG       Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   atlas-vg -wi-ao---- 86.88g                                                    
  swap_1 atlas-vg -wi-ao---- 16.00g    


Disable Systemd DNS resolver

I ran into an issue recently where I tracked back that the systemd resolver was trying to be a tad to helpful and causing me pain through DNS.  So I set out to kill and keep it disabled across reboots.  In some quick googling I found a good answer on askubuntu.com.

Regurgitating what the answer is for my reference later and for anyone to find.  (Along with a reference link below)

  1. Disable systemd-resolvd service:
    sudo systemctl disable systemd-resolved.service
    sudo systemctl disable systemd-resolved-update-resolvconf.service
    sudo service systemd-resolved stop
  2. If file exists, add to “[main]” section in /etc/NetworkManager/NetworkManager.conf
  3. Delete symlink and replace /etc/resolv.conf
  4. Restart network-manager
    sudo service network-manager restart