How to fix wlanO not found

The problem statement is while doing an *ip a* on the terminal and its output doesn’t show the wireless device, like below:

wlan0_not_showing_2017-01-27-22-17-20

The dmesg says like this below:

iwlwifi_firmware_not_found_2017-01-28-04-20-26

Let me cross check that file is present in the system or not,  just like below:

firmware_file_present_2017-01-28-04-23-41

So, it is very much seated there, where it suppose to be  Well, that trigger me trip to visit some kernel config variables, like below:

kernel_var_2017-01-28-04-31-25

It looks fine, then?? well, that warrant few more checks, well I made some trip to *gentoo forum* to know what is missing. And someone in the closed thread mentioned that The variable in question is CONFIG_IWLWIFI which is recommended =m and that necessarily meant I have to recompile the kernel one more time with that variable set to the module in the kernel.

Next, I went ahead and compile the kernel with that mentioned variable as the module. Okay, I have rebooted my machine and here is the outcome,

wlan0_showing_2017-01-28-05-14-35

Cool, but why we have to turn it to a module within the kernel than just straight built into the kernel not showing the device ?? The reason, by the time kernel boot and the firmware file, reside on the filesystem not yet read so it was missing.

Hope this will help.

 

 

 

 

How to sign your git commit?

First thing first,you are supposed to have a digital key. Haven’t you?? Get one!, but how? Here is how to create gpg key from command line.

I am assuming( o yeah I can’t help myself about that! thinking of you being smart enough to figure it out) ,if  you haven’t already installed GNUPG yet , read it here about it and take advantage of your OS’s package manager to install the package .

Again, once you setup your gpg key and uploaded it into the one of the keyserver and it will sync with other keyservers too.  Mind you, only share your public key , the private key should be reside with you.

Heads up! for heaven’s sake please remember the passphrase you enter while creating the key and do not forget to create a revocation certificate too.

Another way , you might start using keybase ,which quite new ,but has promise and will take over gnupg soon( thinking in that direction) . If you want to use , please let me know, I have few invite left with me. But please disclose your original identity .

Now, you need to tell git to use your private key to encrypt your commits ,but how? Here is how you should do ..read on:

I think, this page is very well explained. Give some effort to read it and understand it.

I believe you understood the previous link to gpg signing(again assuming you did!). Once you properly done with it . You can verify like below :

bhaskar@ArchLinux_17:34:07_Fri Nov 25:~/git-linux/Linux_Infrastructure_Management>git log –show-signature -1
commit a825344b39e962dcf3df91a276cfb53fd57db4dc
gpg: Signature made Sun 20 Nov 2016 04:27:44 PM IST
gpg:                using RSA key B23A9DB7114B2915
gpg: Good signature from “Bhaskar Chowdhury (Musing_with_GNU/Linux!!) <unixbhaskar@gmail.com>” [ultimate]
gpg:                 aka “[jpeg image of size 62428]” [ultimate]
Author: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Date:   Sun Nov 20 16:27:33 2016 +0530

modified few sentences

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>

 

But hey! how do you sign the commit??  Two ways:

  1. You need to pass -S  along the line with commit command and give the key hash.This is the laborious way to do thing and soon become very cumbersome.

Of course there is better way and that is second way of doing it:

2. You need to put in the global section of the git config (by doing git config add ) or by placing it for any project specific way . Like below ,I am having this configuration for this project.

bhaskar@ArchLinux_17:41:10_Fri Nov 25:~/git-linux/Linux_Infrastructure_Management>git config –list
user.email=unixbhaskar@gmail.com
user.name=Bhaskar Chowdhury
user.signingkey=**Long hash for key**(hsg23ljfgdrtu456)
push.default=matching
gpg.program=gpg2
commit.gpgsign=true
core.editor=vim
core.abbrev=12
color.ui=true
pretty.fixes=Fixes: %h (“%s”)
log.showsignature=true
alias.logline=log  –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/unixbhaskar/Linux_Infrastructure_Management.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

 

You are good enough to read it through ..aren’t you? By the way , those are git config options ,you need to tell git to use it by providing the key value at the git command line ,like this :

bhaskar@ArchLinux_17:41:26_Fri Nov 25:~/git-linux/Linux_Infrastructure_Management>git config add user.email unixbhaskar@gmail.com

If you did that with your mail id for a the specific project ,it can how you the first line of output shown above. Likewise ,you need to do that for other options too.

Did you notice there is “singed-off-by” ? It can be achieved by using -s (small ess) along the commit message or automate it like other options mentioned above.Why that is there ? Because ,oftentimes ,commiter and the author of the patch is not the same person. Plus for reviewing purpose.So, both author and commiter get credit for the submission 🙂 .

This post is very rudimentary and assuming the reader is capable enough to do lot of research .BTW if you have any genuine query about it ,please do let me know.

 

 

 

RVM- Ruby Version Manager

Exploring RVM

I am trying get a feel for it …following the documentation …probabaly upate later.I was basically doing everything by gem..lack of awareness..heck…

This was provided by my colleague Brian ..thanks mate…

How to install package by Slackbuild script on Slackware

So,installing package on Slackware is pretty different then other distro.You need to work little more to do that .Fortunately some great guys have done all the hard work for us to do thing in minimal way.In this post I will show you how you can install any package from the Slackbuild.org repository with the help of Slackbuild script.

So I a going to install a forensic package called “chkrootkit” from that repo and installed in Slackware.First get into this page chkrootkit to get the source of it as well as Slackbuild source too.

Okay ,once obtain those then please untar the SlackBuild one and it should look like below:

bhaskar@Slackware:~/Downloads/chkrootkit$ ls
README chkrootkit.SlackBuild chkrootkit.info chkrootkit.tar.gz slack-desc

Yes, that tar file inside that directory not come with that Slackbuild source. It’s the other one I have move to that directory,because SlackBuild script require the source of the package should be inside the SlackBuild dir.

Now, next step to execute the SlackBuild script like below:


bhaskar@Slackware:~/Downloads/chkrootkit$ sudo ./chkrootkit.SlackBuild
Password:
chkrootkit-0.49
chkrootkit-0.49/chkrootkit.lsm
chkrootkit-0.49/README.chkwtmp
chkrootkit-0.49/COPYRIGHT
chkrootkit-0.49/Makefile
chkrootkit-0.49/chkutmp.c
chkrootkit-0.49/ifpromisc.c
chkrootkit-0.49/chkrootkit
chkrootkit-0.49/ACKNOWLEDGMENTS
chkrootkit-0.49/check_wtmpx.c
chkrootkit-0.49/chkdirs.c
chkrootkit-0.49/README.chklastlog
chkrootkit-0.49/chklastlog.c
chkrootkit-0.49/strings.c
chkrootkit-0.49/README
chkrootkit-0.49/chkproc.c
chkrootkit-0.49/chkwtmp.c
*** stopping make sense ***
make[1]: Entering directory `/tmp/SBo/chkrootkit-0.49′
gcc -O2 -march=i486 -mtune=i686 -o chklastlog chklastlog.c
gcc -O2 -march=i486 -mtune=i686 -o chkwtmp chkwtmp.c
chkwtmp.c: In function ‘main’:
chkwtmp.c:95:9: warning: incompatible implicit declaration of built-in function ‘exit’
gcc -O2 -march=i486 -mtune=i686 -D_FILE_OFFSET_BITS=64 -o ifpromisc ifpromisc.c
gcc -o chkproc chkproc.c
gcc -o chkdirs chkdirs.c
gcc -o check_wtmpx check_wtmpx.c
gcc -static -o strings-static strings.c
gcc -o chkutmp chkutmp.c
make[1]: Leaving directory `/tmp/SBo/chkrootkit-0.49′

Slackware package maker, version 3.14159.

Searching for symbolic links:

No symbolic links were found, so we won’t make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.

This next step is optional – you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!

Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? n

Creating Slackware package: /tmp/chkrootkit-0.49-i486-2_SBo.tgz

./
install/
install/slack-desc
usr/
usr/sbin/
usr/sbin/chkrootkit
usr/lib/
usr/lib/chkrootkit/
usr/lib/chkrootkit/bin/
usr/lib/chkrootkit/bin/chkwtmp
usr/lib/chkrootkit/bin/strings-static
usr/lib/chkrootkit/bin/chklastlog
usr/lib/chkrootkit/bin/chkproc
usr/lib/chkrootkit/bin/ifpromisc
usr/lib/chkrootkit/bin/chkrootkit
usr/lib/chkrootkit/bin/chkdirs
usr/lib/chkrootkit/bin/check_wtmpx
usr/lib/chkrootkit/bin/chkutmp
usr/doc/
usr/doc/chkrootkit-0.49/
usr/doc/chkrootkit-0.49/COPYRIGHT
usr/doc/chkrootkit-0.49/README.chklastlog
usr/doc/chkrootkit-0.49/chkrootkit.SlackBuild
usr/doc/chkrootkit-0.49/README.chkwtmp
usr/doc/chkrootkit-0.49/ACKNOWLEDGMENTS
usr/doc/chkrootkit-0.49/README
usr/doc/chkrootkit-0.49/chkrootkit.lsm

Slackware package /tmp/chkrootkit-0.49-i486-2_SBo.tgz created.

We need to install that file. So go to the /tmp dir and execute as superuser like below:


root@Slackware:/tmp# installpkg chkrootkit-0.49-i486-2_SBo.tgz
Verifying package chkrootkit-0.49-i486-2_SBo.tgz.
Installing package chkrootkit-0.49-i486-2_SBo.tgz:
PACKAGE DESCRIPTION:
# chkrootkit (Check Rootkit)
#
# chkrootkit is a common unix-based program intended to help system
# administrators check their system for known rootkits. It is a shell
# script using common UNIX/Linux tools like the strings and grep
# commands to search core system programs for signatures and for
# comparing a traversal of the /proc filesystem with the output of
# the ps (process status) command to look for discrepancies.
#
# Homepage: http://www.chkrootkit.org
#
Package chkrootkit-0.49-i486-2_SBo.tgz installed.

Done!!

Check it where the binary is :

bhaskar@Slackware:~$ whereis chkrootkit
chkrootkit: /usr/sbin/chkrootkit /usr/lib/chkrootkit

Start playing with it:

bhaskar@Slackware:~$ sudo /usr/sbin/chkrootkit
ROOTDIR is `/'
Checking `amd'... not found
Checking `basename'... not infected
Checking `biff'... not infected
Checking `chfn'... not infected
Checking `chsh'... not infected
Checking `cron'... not infected
Checking `crontab'... not infected
Checking `date'... not infected
Checking `du'... not infected
Checking `dirname'... not infected
Checking `echo'... not infected
Checking `egrep'... not infected
Checking `env'... not infected
Checking `find'... not infected
Checking `fingerd'... not infected
Checking `gpm'... not infected
Checking `grep'... not infected
Checking `hdparm'... not infected
Checking `su'... not infected
Checking `ifconfig'... not infected
Checking `inetd'... not infected
Checking `inetdconf'... not infected
Checking `identd'... not infected
Checking `init'... not infected
Checking `killall'... not infected
Checking `ldsopreload'... not infected
Checking `login'... not infected
Checking `ls'... not infected
Checking `lsof'... not infected
...output snipped

Hope this will help.

Cheers!
Bhaskar

How to add repository to openSUSE

This is somewhat important to work with GNU/Linux based distributions. Redhat has different way of doing thing,means adding repositories all though both the system using rpm as the base package. Although the package manager is different,in openSUSE they use zypper as the command line package manager.Here is how you can add a repository to the system. I am adding server monitoring repo…

bhaskar@openSUSE_11:23:49_Sun Oct 23:~> sudo /usr/bin/zypper ar -f -c -n server-mon http://download.opensuse.org/repositories/server:/monitoring/openSUSE_11.4/ server-mon
bhaskar's password:
Adding repository 'server-mon' [done]
Repository 'server-mon' successfully added
Enabled: Yes
Autorefresh: Yes
URI: http://download.opensuse.org/repositories/server:/monitoring/openSUSE_11.4/

bhaskar@openSUSE_11:24:23_Sun Oct 23:~> sudo zypper up
Retrieving repository 'server-mon' metadata [|]

New repository or package signing key received:
Key ID: A5C23697EE454F98
Key Name: server:monitoring OBS Project
Key Fingerprint: 8F3BC8EFF549CDCDA918D981A5C23697EE454F98
Key Created: Tue 03 Aug 2010 06:53:39 PM IST
Key Expires: Thu 11 Oct 2012 06:53:39 PM IST
Repository: server-mon

Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): a
Retrieving repository 'server-mon' metadata [done]
Building repository 'server-mon' cache [done]
Loading repository data...
Reading installed packages...

The following package updates will NOT be installed:(ignore this for the time being..I will write about it later in other post)
aaa_base aaa_base-extras coreutils gettext-runtime gstreamer-0_10-fluendo-mp3 iproute2 iptables joe kernel-desktop libfreebl3 libldb0 libsoftokn3 libtalloc2 libtdb1 libtevent0 libzypp
MozillaFirefox MozillaFirefox-branding-openSUSE mozilla-kde4-integration mozilla-nspr mozilla-nss mozilla-nss-certs net-tools nfsidmap openssh openssh-askpass python-satsolver rpm
satsolver-tools screen tar tar-lang w3m xterm zypper

Nothing to do.

Yes, I am started to dealing with it after bit of gap..

Okay, now I am going to install a network bandwidth monitoring tool called vnstat out of that repository. Here is how:


bhaskar@openSUSE_11:55:52_Sun Oct 23:~> sudo zypper in vnstat
bhaskar's password:
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
vnstat

1 new package to install.
Overall download size: 96.0 KiB. After the operation, additional 282.0 KiB will be used.
Continue? [y/n/?] (y): y
Retrieving package vnstat-1.10-3.1.i586 (1/1), 96.0 KiB (282.0 KiB unpacked)
Retrieving: vnstat-1.10-3.1.i586.rpm [done (57.5 KiB/s)]
Installing: vnstat-1.10-3.1 [done]
Additional rpm output:
Creating vnstat group
Creating vnstat user

So it’s that simple..like wise you can install lot of third party repository into the opensuse system.Here is mine repository list..which I am going to trim later:


bhaskar@openSUSE_12:15:22_Sun Oct 23:~> sudo zypper lr -d
# | Alias | Name | Enabled | Refresh | Priority | Type | URI | Service
---+----------------------------------+----------------------------------+---------+---------+----------+--------+---------------------------------------------------------------------------------+--------
1 | Updates-for-openSUSE-11.4-11.4-0 | Updates for openSUSE 11.4 11.4-0 | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/update/11.4/ |
2 | apache | apache | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/Apache/openSUSE_11.4/ |
3 | apache-modules | apache-modules | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/Apache:/Modules/Apache_openSUSE_11.4/ |
4 | apache-php | apache-php | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/server:/php/openSUSE_11.4/ |
5 | google-chrome | google-chrome | Yes | Yes | 99 | rpm-md | http://dl.google.com/linux/chrome/rpm/stable/i386 |
6 | libdvdcss repository | libdvdcss repository | Yes | Yes | 99 | rpm-md | http://opensuse-guide.org/repo/11.4/ |
7 | mozilla | mozilla | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/mozilla/openSUSE_11.4/ |
8 | net-kern-firewall | net-kern-firewall | Yes | Yes | 99 | rpm-md | http://jftp.medozas.de/openSUSE_11.4/ |
9 | openSUSE-11.4-11.4-0 | openSUSE-11.4-11.4-0 | Yes | Yes | 99 | yast2 | http://download.opensuse.org/distribution/11.4/repo/oss/ |
10 | packman-essential | packman-essentials | Yes | Yes | 99 | rpm-md | http://packman.inode.at/suse/openSUSE_11.4/Essentials |
11 | packman-multi | packman-multimedia | Yes | Yes | 99 | rpm-md | http://packman.inode.at/suse/openSUSE_11.4/Multimedia |
12 | packman-repo | packman-repo | Yes | Yes | 99 | rpm-md | http://packman.inode.at/suse/openSUSE_11.4/ |
13 | repo-debug | openSUSE-11.4-Debug | No | Yes | 99 | NONE | http://download.opensuse.org/debug/distribution/11.4/repo/oss/ |
14 | repo-debug-update | openSUSE-11.4-Update-Debug | No | Yes | 99 | NONE | http://download.opensuse.org/debug/update/11.4/ |
15 | repo-non-oss | openSUSE-11.4-Non-Oss | Yes | Yes | 99 | yast2 | http://download.opensuse.org/distribution/11.4/repo/non-oss/ |
16 | repo-source | openSUSE-11.4-Source | No | Yes | 99 | NONE | http://download.opensuse.org/source/distribution/11.4/repo/oss/ |
17 | server-mon | server-mon | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/server:/monitoring/openSUSE_11.4/ |
18 | wine | wine | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/Emulators:/Wine/openSUSE_11.4/

Hope this will help.

Cheers!
Bhaskar

How to get over frozen Debian Squeeze Login Screen

So,like every other ordinary mortals use GNU/Linux and try Debian from netinstall cd to install it..so do I on my laptop.But it got frozen when it boots up and the login screen keyboard and touchpad ..nothing working!! irk..

So as usual a bit of search and I was landed on this page :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593083

and following the instruction resolve the issue.Boy!! I have come across in many distro that this UDEV fellow is giving little trouble to almost everyone..

Hope this help.

Cheers!
Bhaskar

How to turn on/off Nagios service/notification by Curl from commandline

The content of this writing is just include the steps to perform it from the comamndline. I was stuck few months back with that requirement and my client gave me that code (S)he found in Serverfault site.So I went on to put some wrapper around it to make it more interactive.Although the actual requirement was not like that.

Anyway, here is the piece that do the things for me…I am not sure it might work for you…but trying something uncanny thing is not a bad thing at all…provided it’s not a production base.I must confess Nagios is not my forte…I can manage it to some extents.

curl -d " cmd_mod=2cmd_type=56&host=$HOSTNAME&service=$SERVICENAME&btnSubmit=commit" "Url of the nagios server" "username:password"

Every cmd_type number is paired i.e if up is 56 then down is 57 something like that.Like every other action has different cmd_type number attached to it.Now the biggest thing about this ..you need to know the cmd_type number by looking the browser nagios web interface by pointing your cursor over the specific entry. So the above code I put in a wrapper script which basically asking the person to input the hostname, which will be stored in $HOSTNAME variable and the service name ,which will store in the $SERVICENAME variable and of course the cmd_type. Then it will perform the task and show the result in the terminal itself. Now you can go back in the browser and check that it got effected.

Now one more time I was asked by the client to fix the downtime of any particular nagios host from the help of above script…oooops a big ooops… because the downtime command take more mandatory parameter along with the standard one.So I had to accommodate that..so I asked help in the forum and someone replied to me..you can find the reply here : http://stackoverflow.com/questions/6842683/how-to-set-downtime-for-any-specific-nagios-host-for-certain-time-from-commandlin

Hope this help.

Cheers!
Bhaskar