Categories
Unix Websites

Disable search in google chrome address bar

I dislike how Chrome has turned the address bar (also known as a “location bar” or “URL bar”) into an “Omnibox”. Since I run Chrome on my Linux box, and I have a bunch of test hosts defined in my /etc/hosts file, everytime I try to shortcut by just typing a dev hostname, Google pops up a damn search result!

There are some posted methods to avoid this. One was to check chrome://flags, which does have a bunch of nice settings, however my version of Chrome DID NOT have the one to do this!

Instead I found that creating my own search engine option was the solution. Go to chrome://settings/ and choose “Manage Search Engines”. In there, add a new one with “none”, “null” and “http://%s” as the options.

Boom! No more annoying forced search! Suck it, Omnibox!

OK, deep breath.

Categories
Unix

Increasing Network Connections in Centos7

I had a client who was losing network connectivity intermittently recently and it turns out they needed to increase the high limit for network connections. Centos7 has some variable name changes from previous versions so here are some helpful tips on how to increase the limits.

In older Centos you might have seen these error messages:

ip_conntrack version 2.4 (8192 buckets, 65536 max) – 304 bytes per conntrack

In newer verions, something like:

localhost kernel: nf_conntrack: table full, dropping packet

The below is for Centos versions that have renamed the ip_conntrack to nf_conntrack.

To get a list of network parameters:

sysctl -a | grep netfilter

This shows current value for the key parameter:

/sbin/sysctl net.netfilter.nf_conntrack_max

This shows your system current load:

/sbin/sysctl net.netfilter.nf_conntrack_count

So now to update the value in the kernel to triple the limit, of course make sure your RAM has room with what you choose:

/sbin/sysctl -w net.netfilter.nf_conntrack_max=196608

To make it permanent after reboot, please add these values to the /etc/sysctl.conf

net.ipv4.netfilter.ip_conntrack_max=196608

Hope this helps!

Categories
Hardware Photos Unix

Getting Motion working with Vivotek IP Camera

I finally got around to looking into rigging up some security cameras around my home so I can find out what damn neighbors have been letting their dogs do their business in front of my gate! I actually caught one woman and her dog and when I pointed out nicely that there was a tree only 20 feet down the sidewalk, she said her dog wants to urinate where it wants, so she lets it because it pulls the leash. Yeah, well, that’s why you are the HUMAN and the master to the animal. Ah, don’t get me started, that is a whole other blog post.

Anyway, where were we? Oh, right! IP cameras! I decided upon the Vivotek IB8369 since, well, it’s awesome. Works at night, great resolution, nice range, can be outdoors, uses POE, and a bunch of other stuff, check the website, what am I, a sales guy?

OK, next step, I wanted to rig this up using my Linux box, not Windows. So I decided to use Motion to capture AVI video when there is motion detected. It will do so, AND store individual JPG frames so you can pick one that is a nice shot and then post it all around your neighborhood with a caption that says “BAD DOG OWNER”. Your needs may differ.

Getting Motion working was a bit of a hassle, here are a few things I did that could help you if you are trying to set this up also.

First, the camera itself, you should set a static IP on it using it’s web interface, and then I had to go into Configuration->Media->Video and set stream 1 to use JPEG. You will also need to set the “Frame size” to something where the width/height are divisible by 16, otherwise you will see messages like below from the Motion logs:

[1] [CRT] [NET] [Aug 27 18:45:01] netcam_start: netcam image height (1080) is not modulo 16

And here is a screenshot of the webcam settings page:

The next thing is to make sure your /etc/motion.conf has good settings. If you haven’t, you could see messages in the log like:

[1] [NTC] [STR] [Aug 27 18:49:06] http_bindsock: motion-stream testing : IPV4 addr: 127.0.0.1 port: 8081
[1] [CRT] [STR] [Aug 27 18:49:06] http_bindsock: motion-stream bind() failed, retrying:
[1] [ERR] [STR] [Aug 27 18:49:06] http_bindsock: motion-stream socket failed, retrying:
[1] [CRT] [STR] [Aug 27 18:49:06] http_bindsock: motion-stream creating socket/bind ERROR:
[1] [ERR] [ALL] [Aug 27 18:49:06] motion_init: Problem enabling motion-stream server in port 8081:

Most are okay from the defaults, here are the ones I changed to make things work:

netcam_url http://192.168.2.10/video.mjpg
netcam_keepalive on
target_dir /var/motion
stream_motion on
stream_localhost off
webcontrol_localhost off

And then finally the commands to run Motion:

chown motion /var/motion/
service motion start
tail -f /var/log/motion.log

The error log is your friend, and once you have things working nicely, change the log level in the conf file to something more reasonable.

 

 

 

Categories
Unix

Too many systemd: Created slice !

Installing the recent linux version seems to come with a default setting of flooding the /var/log/messages with entirely annoying duplicitous messages like:

 systemd: Created slice user-0.slice.
systemd: Starting Session 1013 of user root.
systemd: Started Session 1013 of user root.
systemd: Created slice user-0.slice.
systemd: Starting Session 1014 of user root.
systemd: Started Session 1014 of user root.

Here is how I got rid of these:

vi /etc/systemd/system.conf

And then uncomment LogLevel and make it: LogLevel=notice

Then:

systemctl restart rsyslog
systemd-analyze set-log-level notice

 

Categories
Hardware Unix

Fedora21 and Video Configuration

Another Fedora upgrade, another few hours spent mucking about with xorg.conf and video settings!

So I have two workstations I was upgrading, one I chose to stick with nouveau and the other I used nvidia drivers.

The nouveau one, I had an older card, the GeForce GTX 275, and the nvidia drivers I downloaded did not work well, so it was easier to stick with nouveau. You can use lspci to see your card info:

/sbin/lspci | grep VGA

Fedora found my card and monitors, but one of them did not get the proper resolution. After a number of failed attempts at configuring xorg.conf, I ended up just using the following in my .xinitrc:

/bin/xrandr –addmode DVI-I-2 1920×1080
/bin/xrandr –output DVI-I-2 –mode 1920×1080

and that worked. You could also put that in a file like “/etc/X11/xinit/xinitrc.d/99-xrandr” like this, and make sure you “chmod a+x” on the file:

#!/bin/sh
/bin/xrandr –addmode DVI-I-2 1920×1080
/bin/xrandr –output DVI-I-2 –mode 1920×1080

For the nvidia install, I had to do the following steps

  • Download the driver from http://www.geforce.com/drivers
  • Drop out of the GUI with “init 3” as root
  • Run the driver file, i.e. “sh ./NVIDIA-Linux-x86_64-340.76.run”
  • When you run the file, it will ask if you want to blacklist the nouveau stuff, and the answer is yes! It will create “/etc/modprobe.d/nvidia-installer-disable-nouveau.conf” with the following:

# generated by nvidia-installer
blacklist nouveau
options nouveau modeset=0

Then you need to edit your grub file “/boot/grub2/grub.cfg” and find your recent vmlinuz line and add this to the end of it:

rdblacklist=nouveau

Then you can reboot. You’ll need to muck with the xorg.conf, you can see my version here.

Another thing to note, you should make note of your IP address, if you wreck your video output and can’t get the GUI to show anymore, you can still SSH into the machine and change things and reboot. I got into a case where my box had DHCP so I didn’t know the IP anymore, and I did the following to get in and fix my xorg.conf:

  • Boot up the live CD
  • You want to mount your drive now, but first you need to find it via “pvs”
  • Pvs will show you the name to use for “lvdisplay fedora” as an example, you may need to change “fedora” to your drive name
  • Lvdisplay will show you the LVM partitions, you want to mount the root partition to get into /etc/X11, I had to do “mount /dev/fedora/lv_root /mnt”

Once mounted, you can tweak the grub or the xorg.conf, whichever caused you to lose the video settings!

Hope this helps someone!

Categories
Unix

Installing MDB Tools in CentOS 7

MDB tools sure do come in handy when you have to handle someone’s old nasty microsoft access files!

On older Centos, I could just yum add mdbtools, but on Centos 7 I found the following was required.

First, you need to make sure you add these packages (you may need others in addition but these were the ones I had to add):

yum -y install glib2-devel
yum -y install autoconf
yum -y install automake
yum -y install txt2man
yum -y install gnome-doc-utils
yum -y install libtool
yum -y install unixODBC unixODBC-devel
yum -y install flex flex-devel bison bison-devel

Why did I split all that into 8 lines when I guess we could have just stuck them all in one? Why did I put flex and bison in one line, but not others? Who knows! Just roll with it.

Then you need to grab the source and compile:

mkdir tmp1; cd tmp1
git clone https://github.com/brianb/mdbtools.git mdbtools
cd mdbtools
autoreconf -i -f
./configure –with-unixodbc=/usr
make
make install

 

Categories
Unix

SSH hangs when expecting SSH2_MSG_KEX_DH_GEX_GROUP

I encountered this odd issue when I went to SSH from a new CentOS 7 box to an older system, and it just hung with no response. Turning on verbose showed me where it was hanging:

debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP

I found a number of suggestions on the ‘net as to how to handle this, but the below worked for me. It is a compatibility issue with a newer openSSH connecting to an older one that doesn’t have ciphers as strong.

You need to edit /etc/ssh_config and I added the following to the bottom, so it is under the “host *” items:

SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIDelegateCredentials no
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
HostKeyAlgorithms ssh-rsa,ssh-dss
MACs hmac-md5,hmac-sha1,hmac-ripemd160

Categories
Unix

Problem using virsh-install with Debian ISO

Doing a virsh-install with a debian image, specifically debian-7.8.0-amd64-netinst.iso, I was getting the following error:

ERROR Could not find an installable distribution at ‘/home/vm/debian-7.8.0-amd64-netinst.iso’

The location must be the root directory of an install tree.

After trying a number of things, including trying different path locations like /cdrom, it turns out the virsh-install command prefers “-c” instead of “–location” for this ISO! This is similar also to the WindowsXP ISO. So the following worked for me:

virt-install –name=vm_deb1 –ram=8192 –vcpus=1,cores=1 \

–disk path=/home/vm/vm_deb1.img,size=60 –network bridge=br0 \

-c /home/vm/debian-7.8.0-amd64-netinst.iso –os-type=linux –os-variant=debiansqueeze \

–graphics vnc,password=xxx,port=5901,listen=192.168.1.2

Categories
Unix

Chrome on linux generating a ton of syslogd messages

I just did a yum update on my google-chrome-stable package and now whenever I start chrome, or open a new tab, ALL my terminal sessions spit out a bunch of annoying messages like:

Message from syslogd@zx at Dec 31 13:43:51 …

kernel:[1132591.932211] CPU: 0 PID: 23825 Comm: chrome Tainted: PF D C O 3.11.10-100.fc18.i686.PAE #1

Message from syslogd@zx at Dec 31 13:43:51 …

kernel:[1132591.932212] Hardware name: EVGA 122-CK-NF68/122-CK-NF68, BIOS 6.00 PG 09/28/2007

Message from syslogd@zx at Dec 31 13:43:51 …

kernel:[1132591.932214] task: dcc1a760 ti: c0c9a000 task.ti: c0c9a000

Message from syslogd@zx at Dec 31 13:43:51 …

kernel:[1132591.932228] Stack:

Message from syslogd@zx at Dec 31 13:43:51 …

kernel:[1132591.932240] Call Trace:

Message from syslogd@zx at Dec 31 13:43:51 …

kernel:[1132591.932249] Code: 7d fc 89 ec 5d c3 90 8d 74 26 00 c7 43 34 00 00 00 00 b9 d0 1b c3 c0 89 da c7 43 38 00 00 00 00 89 f8 e8 24 eb ff ff 89 c6 eb 91 <0f> 0b 8d b4 26 00 00 00 00 8d bc 27 00 00 00 00 55 89 e5 57 56

Message from syslogd@zx at Dec 31 13:43:51 …

kernel:[1132591.932268] EIP: [<c04c9880>] __audit_syscall_entry+0xf0/0x100 SS:ESP 0068:c0c9bfa4

 

Now this could be due to me having an older Fedora, or an older video card, or lord knows what else, but I just wanted to get rid of those messages! So here’s the fix, edit “/etc/rsyslog.conf” and comment out the line that has “*.emerg”

Then “service rsyslog restart”

A quick and dirty fix for now!

 

Categories
Unix

SSH: Could not load host key: /etc/ssh/ssh_host_rsa_key

After doing a yum update the other day I would get these warnings in /var/log/messages and when doing ssh into the host:

error: Could not load host key: /etc/ssh/ssh_host_key

To fix this, you need to be root and:

/usr/bin/ssh-keygen -A

service sshd restart