Azure devops git (ssh) config on linux

I am using fedora linux as my development environment OS, I love it but when you are working with azure that mainly believes you are using windows. Then you have to make some changes to your configuration files that windows (may do??) for you.

So, after I created my ssh key for the development, I keep on getting an issue to pull/push up my local git repo where the CLI would just hang or error out, so after doing the -v (verbose mode)

git pull -v

The issue highlighted itself with the following error message

Unable to negotiate with 51.104.26.0 port 22: no matching host key type found. Their offer: ssh-rsa

So, all I did was to update the ~/.ssh/config (your local username home directory .ssh config(uration) file. Please note the last bits, the HostkeyAlgorithms and PubkeyAcceptedKeyTypes

Host ssh.dev.azure.com
       PreferredAuthentications publickey
       IdentityFile ~/your/key
       UpdateHostKeys no
       IdentitiesOnly yes
       HostkeyAlgorithms +ssh-rsa
       PubkeyAcceptedKeyTypes +ssh-rsa,rsa-sha2-256,rsa-sha2-512

After that, there were no issues, I suppose it is the classic of reading the error message!

Linux – Steam – Half life 2

I have started to use Arch linux as my main linux distro and to be honest it is very close to gentoo linux with regards to custom building what type of setup you are wanting, but without the pain of compiling.

You do lose some of the configuration options compared to gentoo, but to be honest not enough to be spending that time compiling!.

So I am using kde, with also having steam to play some games :), but the half life 2 game kept on crashing and upon ssh’ing onto the box there was the error within dmesg of

[ 2334.498295] INFO: task hl2_linux:4442 blocked for more than 120 seconds.
[ 2334.498298]       Not tainted 4.8.13-1-ARCH #1
[ 2334.498300] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 2334.498303] hl2_linux       D ffff8807cdeeba88     0  4442      1 0x20020006
[ 2334.498308]  ffff8807cdeeba88 00ff8807cdeebb50 ffff88081af15580 ffff8807c8169c80
[ 2334.498312]  0000000000000000 ffff8807cdeec000 ffff880817c1c580 ffff880817c1c548
[ 2334.498317]  ffff880817c18000 ffff8807641ef828 ffff8807cdeebaa0 ffffffff815f40ec
[ 2334.498321] Call Trace:
[ 2334.498324]  [<ffffffff815f40ec>] schedule+0x3c/0x90
[ 2334.498359]  [<ffffffffa0144ab8>] amd_sched_entity_fini+0x68/0x100 [amdgpu]
[ 2334.498364]  [<ffffffff810c0450>] ? wake_atomic_t_function+0x60/0x60
[ 2334.498396]  [<ffffffffa010c2dd>] amdgpu_ctx_fini+0xcd/0x110 [amdgpu]
[ 2334.498427]  [<ffffffffa010cb65>] amdgpu_ctx_mgr_fini+0x65/0xa0 [amdgpu]
[ 2334.498454]  [<ffffffffa00e520e>] amdgpu_driver_postclose_kms+0x3e/0xd0 [amdgpu]
[ 2334.498465]  [<ffffffffa0004703>] drm_release+0x203/0x380 [drm]
[ 2334.498469]  [<ffffffff8120b42f>] __fput+0x9f/0x1e0
[ 2334.498472]  [<ffffffff8120b5ae>] ____fput+0xe/0x10
[ 2334.498475]  [<ffffffff8109a0d0>] task_work_run+0x80/0xa0
[ 2334.498479]  [<ffffffff810806e2>] do_exit+0x2c2/0xb50
[ 2334.498483]  [<ffffffff810b4155>] ? put_prev_entity+0x35/0x8c0
[ 2334.498487]  [<ffffffff81080feb>] do_group_exit+0x3b/0xb0
[ 2334.498490]  [<ffffffff8108be08>] get_signal+0x268/0x640
[ 2334.498494]  [<ffffffff8102d0f7>] do_signal+0x37/0x6b0
[ 2334.498498]  [<ffffffff815f7241>] ? do_nanosleep+0x91/0xf0
[ 2334.498501]  [<ffffffff810ecdb0>] ? hrtimer_init+0x120/0x120
[ 2334.498504]  [<ffffffff815f720a>] ? do_nanosleep+0x5a/0xf0
[ 2334.498508]  [<ffffffff81003651>] exit_to_usermode_loop+0xa1/0xc0
[ 2334.498511]  [<ffffffff81003df7>] do_fast_syscall_32+0x157/0x170
[ 2334.498515]  [<ffffffff815f987b>] entry_SYSCALL_compat+0x3b/0x40
</ffffffff815f987b></ffffffff81003df7></ffffffff81003651></ffffffff815f720a></ffffffff810ecdb0></ffffffff815f7241></ffffffff8102d0f7></ffffffff8108be08></ffffffff81080feb></ffffffff810b4155></ffffffff810806e2></ffffffff8109a0d0></ffffffff8120b5ae></ffffffff8120b42f></ffffffffa0004703></ffffffffa00e520e></ffffffffa010cb65></ffffffffa010c2dd></ffffffff810c0450></ffffffffa0144ab8></ffffffff815f40ec>

of which was to do with the AMDGPU-PRO graphics driver.

So with some digging around you are able to alter the video settings within half life 2, so if you goto “options->Video” the below will be shown

Then click on “advanced”, which will show

If you turn “Multicore Rendering” to disabled and also “Wait for vertical sync” to Enabled, this should stop half life 2 from crashing.

Happy gaming.!!!.

Node – install and test

One of my friends asked me what is Node and also how do you install and test to make sure it is working.

Well, Node is in essence a javascript server side environment that allows you to write code that will allow the event model to handle requests very quickly since it does not handle the I/O (well almost of all of the functions within node do not!) so there is no-blocking of code.

Node has a very quick and capable http class that allows for the user to create a server that is capable of doing some very quick responses to multiple connections.

To install Node you just need to do this in ubuntu

sudo -s
apt-get install python-software-properties
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs
exit

the first line allows you to be the root and thus the next commands are as the user root.

Or if you are using windows just download the executable from here

To test the node to make sure it is working with a basic “Hello world!” example if you save this below as helloworld.js.

var http = require("http");
// create the http server function req'uest, res'ult
http.createServer(function (req, res) 
{
    // 200 = means http response code of found page, then a array of the content type
    res.writeHead(200, {'Content-Type' : 'text/plain'});
    res.end('Hello world!');  // write out the text
}).listen(8080,'127.0.0.1');
// listen on port 8080 on the ip address 127.0.0.1
console.log('We have started, check your browser on http://127.0.0.1:8080/');

I am using a higher number than 1024 for the port because below that you need to be a root user or administrator on windows to allow anything to connect to those port numbers.

So if you now run the program with the javascript file above as the second parameter

node helloworld.js

and then if you open your browser at 127.0.0.1:8080 then you will see

Hello world!

X session cannot start /tmp

If you get a error like

Error: X session cannot start /tmp 
Error: unable to write to the /tmp

or similar errors to the above when trying to log into KDE

it could be because you have run out of inodes (the disk structure that allows you to create new files) or hard drive space.

I had this same problem, and after doing

apt-get clean

to clean out of the temporary files that apt-get has used

and also since I am compiling up my own kernels, I deleted some of the

/usr/src 
 
linux-source
linux-source-2.6.32

directories and then I was able to start up X, which is great.. something of a better error would have been better.. cannot create file, make sure that you have the space!!. sort of thing..

also sometimes if your X session does not start, if you delete your home directory (The user’s home directory that you are trying to login to) .Xauthority

e.g.

rm ~/.Xauthority

because that is sometimes a lock on the xsession.

Rewrite Engine

Because I own the codingfriends.co.uk, but would like to point that to the www.codingfriends.com

Here is a good way to make it so that any requests to the domain name codingfriends.co.uk (rewrite condition of the host record) will redirect to www.codingfriends.com with a redirection of HTTP 301 (moved permanently).

RewriteEngine On
RewriteCond ${HTTP_HOST} !^(www)\.codingfriends\.co\.uk 
RewriteRule (.*) http://www.codingfriends.com/$1 [L,R=301]

Save that to the .htaccess root directory file. Hope that helps.

upstart – emit – start on network

I have been reading some of the funky things in ubuntu implementations that has been happening in the distribution. One of the things that I like is the upstart, this changes the way that init (the process of the computer system from boot to console/GUI for creating the different runlevels ).

In essence, it replaces the /sys/init daemon which handles the start up and shutting down, looking after tasks/services during boot/running and shutdown.

One of the things that is great is that the upstart will “emit” and signal to other services to “start on” when that signal has been emitted, to demonstrate this when a network card is activated for the Ethernet (for example) in the “/etc/network/if-up.d/upstart”

initctl emit -n net-device-up \

which basically says when a network device because in a state of up emit a signal, the state of being up is when the device is active. Then in the /etc/init/mountall-net.conf file

description     "Mount network filesystems"
 
start on net-device-up

is listening for the emitted signal of net-device-up and thus the upstart will start the networking filesystems.

Another example is within the /etc/init/mountall.conf there is the emitting of a signal

mountall.conf:emits virtual-filesystems

the signal is virtual-filesystems which is then picked up with the udev.conf with the

start on virtual-filesystems

since udev is a virtual filesystem in the /dev and /sys directories.

I find the stuff that Canonical is doing with the ubuntu linux distribution is just great.