Categories
Linux shell

Linux distribution info & kernel info

Do you have multiple vms and real machines you use for random testing, and small tasks? need to know what machine you are on? what kernel you are using? what the current Linux distribution info is? what OS version did you last install on here? and more such questions? well! we have some of the answers for you. well maybe not answers, but more like small tools so you can get the answers!

Distribution info

lsb_release -a
on my ubuntu system it gives the following result :

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Xenial Xerus (development branch)
Release: 16.04
Codename: xenial

On a debian system it gives the following result :

# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.4 (jessie)
Release: 8.4
Codename: jessie

If lsb_release -a doesn’t cut it for you then you can try
cat /etc/issue

as a result we see the following examples :

# cat /etc/issue
Debian GNU/Linux 8 \n \l

$ cat /etc/issue
Ubuntu Xenial Xerus (development branch) \n \l

In some cases where you suspect you are on centos or redhat, maybe because you noticed the package versions are old enough to be used by columbus while sailing the open seas, then you can use either

cat /etc/centos-release

or

cat /etc/redhat-release

which will give you result such as :

CentOS release 6.2 (Final)

Kernel Info

now as far as finding the kernel info goes you can get all the info you need via uname.

$ uname -a
Linux testhost 4.4.0-9-generic #24-Ubuntu SMP Mon Feb 29 19:33:19 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ uname -r
4.4.0-9-generic

as you can see uname -r gives you just the kernel version and uname -a gives you multiple pieces of info, like date the kernel was compiled, the arch (i.e. x86_64).

Categories
General Linux nginx shell

Letsencrypt ssl cert for mumble

I needed to set up a mumble server for a friends minecraft community. The Mumble software uses a client–server architecture which allows users to talk to each other via the same server. It has a very simple administrative interface and features high sound quality and low latency where possible. All communication is encrypted to make sure user privacy using either a self signed cert or a cert purchased via a vendor. The great thing about Mumble is that it’s free and open-source software, is cross-platform, and is released under the terms of the new BSD license. Since letsencrypt is awesome and provides completely free certs to the end users, I figured it would be perfect to use in this attempt.  So I started on the road to acquire a letsencrypt ssl cert for mumble.

First we need to acquire the letsencrypt client. for this you need git.

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
./letsencrypt-auto certonly --standalone --standalone-supported-challenges tls-sni-01

A text / curses bases dialogue will start. it will ask you to input your domain(s) you want a cert for. If you want multiple domains or multiple subdomains at the same time just separate them via a space or a comma, follow the prompts and it will install your cert in /etc/letsencrypt/live/<domain>/cert.pem. So far so good! now you need to install murmur/mumble-server on your machine. I would like to tell you how to do it but due to the nature of software it might change, the best way to do it is via checking the official mumble wiki for info on how to do it for your OS. To do it in Ubuntu I used the following commands

sudo add-apt-repository ppa:mumble/release
sudo apt-get update
sudo apt-get install mumble-server
sudo dpkg-reconfigure mumble-server

Now lets setup the mumble server to use the certs we acquired earlier.  Edit /etc/mumble-server.ini , I prefer using nano but it’s because I am a pleb, you may be a super 1337 operator and use vi or vim or directly edit the 1’s and 0’s on the drive platters. Find the following keys and edit them or add if they don’t exist or are commented out.

sslCert=/etc/letsencrypt/live/<domain>/cert.pem
sslKey=/etc/letsencrypt/live/<domain>/privkey.pem
sslCA=/etc/letsencrypt/live/<domain>/fullchain.pem

the sslCA may not exist, thats fine, this allows all mumble clients to accept the cert from LE. One last issue you need to resolve before you can start mumble-server is the ssl cert is root only access at the moment. the way I resolved this is to change the group on the files and folders. you may have a better solution, please do share it in the comments.

chgrp -R ssl-cert /etc/letsencrypt
chmod -R g=rX /etc/letsencrypt

now start mumble-server with a service mumble-server restart or whatever your OS accepts, and Voila! you are now up and running using a valid letsencrypt ssl cert for mumble 🙂 if you have any questions, or comments, or better way of doing this please let me know.

 

Categories
General

Remove spaces from file names via bash

if you need a simple way to remove spaces from file names and replace with an underscore or a hyphen or whatever else here is a bash one liner. You can also do this via python or perl or most likely via php (why? o.0) but since bash / zsh is here and readily available for me I choose to use bash / zsh.

Remove spaces and replace with underscore:

find /tmp/ -depth -name "* *" -execdir rename 's/ /_/g' "{}" \;

remove spaces and replace with hyphen :

find /tmp/ -depth -name "* *" -execdir rename 's/ /-/g' "{}" \;

Remove spaces completely:

find /tmp/ -depth -name "* *" -execdir rename 's/ //g' "{}" \;

Be careful with he above as it will remove all spaces from file and directory names.

hope this helps. if you have a better way of doing it comment and let me know 🙂

Categories
Linux

Linux HP Smart Array Raid Controller

A client has a machine in a DC that has a raid controller and 4 hdd’s set to raid 10, that’s all I was told. I wanted to keep an eye on the hdds, so I needed to install a utility that can monitor and interact with the raid controller.  In my case I have the hp smart array raid controller as you will see in just a bit, you may have a different controller from this one by a different manufacturer, or it may require a different version of the software tool from HP, please check on the HP site linked below before continuing on. There is a chance of serious data loss if you don’t follow common sense practices and MAKE BACKUPS. I needed to do a few things, find out which controller is it, find latest of control utility for it, install said utility and then check on the drives. that isnt always easy, sadly.

First we check who makes this system.
dmidecode | grep -A3 ‘^System Information’
Sample result:

System Information
Manufacturer: HP
Product Name: ProLiant DL160 G6
Version:

Second we check lspci to see what controller we have installed.
lspci -k|grep -i -A2 raid
Sample Result :

04:00.0 RAID bus controller: Hewlett-Packard Company Smart Array G6 controllers (rev 01)
Subsystem: Hewlett-Packard Company Smart Array P410
Kernel driver in use: hpsa

Now we know we have a HP machine, DL160 G6 to be exact in this case, and the exact rev of the card itself. We need to install the HP provided software for it.  The official HP software page for the information below is here.  However as its laid out, best of luck getting up and running quickly if you follow that page.

Get and install HP Keys. (Keys are in the following order: software release pre 2014, during 2014, and post 2014)

curl http://downloads.linux.hpe.com/SDR/hpPublicKey1024.pub | apt-key add -
curl http://downloads.linux.hpe.com/SDR/hpPublicKey2048.pub | apt-key add -
curl http://downloads.linux.hpe.com/SDR/hpPublicKey2048_key1.pub | apt-key add -

Add the HP repo (be sure to change the jessie to whatever your release is):

echo -e "deb http://downloads.linux.hpe.com/SDR/repo/mcp/ jessie/current non-free" > /etc/apt/sources.list.d/hpe.list

Then update sources and install package :

apt-get update && apt-get install hpssacli

Now you have the tools needed for the job! so run the utility

hpssacli

sample result:

HP Smart Storage Administrator CLI 2.10.14.0
Detecting Controllers…Done.
Type “help” for a list of supported commands.
Type “exit” to close the console.

=>

There are a few commands you can use on this CLI:

Show all config :

=> ctrl all show config

Smart Array P410 in Slot 4 (sn: PACCRID12290K57)
Internal Drive Cage at Port 1I, Box 1, OK
array A (SATA, Unused Space: 0 MB)
logicaldrive 1 (1.8 TB, RAID 1+0, OK)

physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SATA, 1 TB, OK)
physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SATA, 1 TB, OK)
physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SATA, 1 TB, OK)
physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SATA, 1 TB, OK)

SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 (WWID: 5001438021BEED2F)

Show Status:

=> ctrl all show status

Smart Array P410 in Slot 4
Controller Status: OK
Cache Status: OK

View drive status (change slot # to thew one from show status command above):

=> ctrl slot=4 pd all show status

physicaldrive 1I:1:1 (port 1I:box 1:bay 1, 1 TB): OK
physicaldrive 1I:1:2 (port 1I:box 1:bay 2, 1 TB): OK
physicaldrive 1I:1:3 (port 1I:box 1:bay 3, 1 TB): OK
physicaldrive 1I:1:4 (port 1I:box 1:bay 4, 1 TB): OK

If you get an error like the following you are using the wrong slot number, just run ctrl all show status and use the proper slot number:

ctrl slot=0 pd all show status

Error: The controller identified by “slot=0” was not detected.

View each individual drive and its info :

ctrl slot=4 pd 1I:1:4 show detail

Smart Array P410 in Slot 4

array A

physicaldrive 1I:1:4
Port: 1I
Box: 1
Bay: 4
Status: OK
Drive Type: Data Drive
Interface Type: SATA
Size: 1 TB
Native Block Size: 512
Rotational Speed: 7200
Firmware Revision: HPG2
Serial Number: Z1N3S3ZS
Model: ATA MB1000CBZQE
SATA NCQ Capable: True
SATA NCQ Enabled: True
Current Temperature (C): 28
Maximum Temperature (C): 51
PHY Count: 1
PHY Transfer Rate: 1.5Gbps

Show all logical drives:

ctrl slot=4 ld all show

Smart Array P410 in Slot 4

array A

logicaldrive 1 (1.8 TB, RAID 1+0, OK)

Hope this helps some of you out as it took me a little bit to get all the information together for my setup, so I’m storing it here for future usage 🙂

 

 

Categories
General

Google Alphabet – what is Alphabet?

Google is now Alphabet!?

Ok so what is alphabet and why am I saying google is now alphabet? Well according to abc.xyz

Alphabet Inc. will replace Google Inc. as the publicly-traded entity and all shares of Google will automatically convert into the same number of shares of Alphabet, with all of the same rights. Google will become a wholly-owned subsidiary of Alphabet. Our two classes of shares will continue to trade on Nasdaq as GOOGL and GOOG.

So, google is now owned by a parent company by the name of Alphabet. Alphabet will allow google to divest of side projects which may become alphabet projects. Google founder Larry Page mentioned it would be a simplify the structure for what had become a diverse group of businesses.  mentioning focus on their core projects he said on google blogspot blog :

“This new structure will allow us to keep tremendous focus on the extraordinary opportunities we have inside of Google” “Our company is operating well today, but we think we can make it cleaner and more accountable” … ” The whole point is that Alphabet companies should have independence and develop their own brands.”

Google Alphabet is a reiteration of google’s promise to always try to do the best for their users and their investors. Lets see how they achieve this in the future but it seems like an interesting move.

The people at Google Alphabet

Some of the well-known faces around google will move around between Google & Alphabet while others will keep their positions and yet others will share roles between both. A simple breakdown, as revealed so far, is as following:

  • Larry Page – chief executive of Alphabet
  • Sundar Pichai – CEO of Google
  • Sergey Brin – President of Alphabet
  • Ruth Porat – CFO Google & Alphabet

When prodded about the name Mr Page said the name  Alphabet was chosen for two reasons, It represents language, “the core of how we index with Google search”, and because Alpha-bet means “investment return above benchmark, which we strive to do”.

So what moves from Google to ALphabet? Nest the home automation system, the research and investment division, Calico are notably moving to ALphabet.

This is very reminiscent of Warren Buffet’s massive holding company, Berkshire Hathaway, which owns lots of diversified holdings.

 

More to come as we find out more info.

Categories
game

Mount & Blade 2 Bannerlord trailer

[et_pb_section admin_label=”Section” fullwidth=”on” specialty=”off”][et_pb_fullwidth_post_title admin_label=”Fullwidth Post Title” title=”on” meta=”on” author=”off” date=”on” categories=”on” comments=”off” featured_image=”on” featured_placement=”background” parallax_effect=”off” parallax_method=”on” text_orientation=”center” text_color=”dark” text_background=”on” text_bg_color=”rgba(255,255,255,0.9)” module_bg_color=”rgba(255,255,255,0)” title_all_caps=”off” use_border_color=”off” border_color=”#ffffff” border_style=”solid”] [/et_pb_fullwidth_post_title][/et_pb_section][et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_video admin_label=”Video – intro” src=”https://www.youtube.com/watch?v=pTbaWgLjN6s” /][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

I loved mount & Blade series, it was pretty awesome to recruit people from villages, train and attack large towns and castles with them. so I was excited to hear the new iteration of the series Mount & blade 2 bannerlord is on its way! Check out the Mount & Blade 2 Bannerlord trailer above.

On one hand im excited that the graphics got an overhaul, but man those battles could get real large….

Mount & Blade Large battle
Mount & Blade Large battle

Well what happens when you have 1000 or 1500 chars on single battlefield. Cant wait for the burning smell of my GFX card then 🙂 So what has Taleworld done in the past 5 years since the last copy of M&B? well they have designed, written & implemented a whole new game engine! Im hoping it is a fully moddable engine like their old one which really allowed modders a lot of freedom. Another cool additive is the replay system which allows us to replay old battles from various angles and points allowing for cinematic excellence, hopefully this will bring lots of awesome cuts of M&B battles to youtube in the near future.

They have added a whole new bartering system to the game. Some of you might be thinking, hmm did they clone the witcher series? well maybe, but the thing is I love the witcher series and they are my all time top fav games of their genre but they don’t own the bartering system in games, it has been there for a long time in many games.

mount & blade bannerlord barter

here’s a developer preview of how they designed parts of the game and why they designed it that way. such as the way they optimize the terrain to maximize view distance.

Info gleaned from various sources including by not limited to Taleworlds blog.

[/et_pb_text][et_pb_gallery admin_label=”Gallery” gallery_ids=”755,772,757,758,759,760,761,762,763,764,765,766,767,768″ fullwidth=”on” show_title_and_caption=”on” show_pagination=”on” background_layout=”light” auto=”on” auto_speed=”7485″ hover_overlay_color=”rgba(255,255,255,0.9)” caption_all_caps=”off” use_border_color=”off” border_color=”#ffffff” border_style=”solid” /][et_pb_video admin_label=”Video – gameplay” src=”https://www.youtube.com/watch?v=3P8AYtiaaFE” /][/et_pb_column][/et_pb_row][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”bottom above footer” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

[/et_pb_text][et_pb_divider admin_label=”Divider” color=”#ffffff” show_divider=”off” divider_style=”solid” divider_position=”top” hide_on_mobile=”on”] [/et_pb_divider][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”] [jetpack-related-posts] [/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]