Setting up Node Exporter on init and systems systems

Node exporter default collectors:


Enabled by default

--collector.systemd.enable-task-metrics
--collector.systemd.enable-restarts-metrics
--collector.systemd.enable-start-time-metrics
--collector.arp Enable the arp collector (default: enabled).
--collector.bcache Enable the bcache collector (default: enabled).
--collector.bonding Enable the bonding collector (default: enabled).
--collector.btrfs Enable the btrfs collector (default: enabled).
--collector.conntrack Enable the conntrack collector (default: enabled).
--collector.cpu Enable the cpu collector (default: enabled).
--collector.cpufreq Enable the cpufreq collector (default: enabled).
--collector.diskstats Enable the diskstats collector (default: enabled).
--collector.edac Enable the edac collector (default: enabled).
--collector.entropy Enable the entropy collector (default: enabled).
--collector.fibrechannel Enable the fibrechannel collector (default: enabled).
--collector.filefd Enable the filefd collector (default: enabled).
--collector.filesystem Enable the filesystem collector (default: enabled).
--collector.hwmon Enable the hwmon collector (default: enabled).
--collector.infiniband Enable the infiniband collector (default: enabled).
--collector.ipvs Enable the ipvs collector (default: enabled).
--collector.loadavg Enable the loadavg collector (default: enabled).
--collector.mdadm Enable the mdadm collector (default: enabled).
--collector.meminfo Enable the meminfo collector (default: enabled).
--collector.netclass Enable the netclass collector (default: enabled).
--collector.netdev Enable the netdev collector (default: enabled).
--collector.netstat Enable the netstat collector (default: enabled).
--collector.nfs Enable the nfs collector (default: enabled).
--collector.nfsd Enable the nfsd collector (default: enabled).
Enable the powersupplyclass collector (default: enabled).
--collector.pressure Enable the pressure collector (default: enabled).
--collector.rapl Enable the rapl collector (default: enabled).
--collector.schedstat Enable the schedstat collector (default: enabled).
--collector.sockstat Enable the sockstat collector (default: enabled).
--collector.softnet Enable the softnet collector (default: enabled).
--collector.stat Enable the stat collector (default: enabled).
--collector.textfile Enable the textfile collector (default: enabled).
--collector.thermal_zone Enable the thermal_zone collector (default: enabled).
--collector.time Enable the time collector (default: enabled).
--collector.timex Enable the timex collector (default: enabled).
--collector.udp_queues Enable the udp_queues collector (default: enabled).
--collector.uname Enable the uname collector (default: enabled).
--collector.vmstat Enable the vmstat collector (default: enabled).
--collector.xfs Enable the xfs collector (default: enabled).
--collector.zfs Enable the zfs collector (default: enabled).
--web.config="" [EXPERIMENTAL] Path to config yaml file that can enable TLS or authentication.


Disabled by default

--collector.buddyinfo Enable the buddyinfo collector (default: disabled).
--collector.drbd Enable the drbd collector (default: disabled).
--collector.interrupts Enable the interrupts collector (default: disabled).
--collector.ksmd Enable the ksmd collector (default: disabled).
--collector.logind Enable the logind collector (default: disabled).
--collector.meminfo_numa Enable the meminfo_numa collector (default: disabled).
--collector.mountstats Enable the mountstats collector (default: disabled).
--collector.network_route Enable the network_route collector (default: disabled).
--collector.ntp Enable the ntp collector (default: disabled).
--collector.perf Enable the perf collector (default: disabled).
--collector.processes Enable the processes collector (default: disabled).
--collector.qdisc Enable the qdisc collector (default: disabled).
--collector.runit Enable the runit collector (default: disabled).
--collector.supervisord Enable the supervisord collector (default: disabled).
--collector.systemd Enable the systemd collector (default: disabled).
--collector.tcpstat Enable the tcpstat collector (default: disabled).
--collector.wifi Enable the wifi collector (default: disabled).
--collector.zoneinfo Enable the zoneinfo collector (default: disabled).
--web.disable-exporter-metrics
--web.max-requests=40 Maximum number of parallel scrape requests. Use 0 to disable.
--collector.disable-defaults
Set all collectors to disabled by default.


Init systems:


Service file

cat /etc/init.d/node_exporter
#!/bin/bash
OPTIONS=`cat /etc/sysconfig/node_exporter`
RETVAL=0
PROG="node_exporter"
EXEC="/usr/local/bin/node_exporter"
LOCKFILE="/var/lock/subsys/$PROG"
LOGFILE=/var/log/node_exporter.log
ErrLOGFILE=/var/log/node_exporter_error.log
# Source function library.
if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
else
echo "/etc/rc.d/init.d/functions is not exists"
exit 0
fi
start() {
if [ -f $LOCKFILE ]
then
echo "$PROG is already running!"
else
echo -n "Starting $PROG: "
nohup $EXEC $OPTIONS > $LOGFILE 2> $ErrLOGFILE &
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCKFILE && success || failure
echo
return $RETVAL
fi
}
stop() {
echo -n "Stopping $PROG: "
killproc $EXEC
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -r $LOCKFILE && success || failure
echo
}
restart ()
{
stop
sleep 1
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $PROG
;;
restart)
restart
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL


Config file

cat /etc/sysconfig/node_exporter
--collector.filesystem.mount-points-exclude=^/(home|proc|run/credentials/.+|sys|var/lib/docker/.+)($|/) --collector.filesystem.fs-types-exclude=^(nfs|nfs4|fuse.vmware-vmblock|autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$ --no-collector.arp --no-collector.btrfs --no-collector.fibrechannel --no-collector.infiniband --no-collector.nfs --no-collector.tapestats --no-collector.thermal_zone --collector.textfile.directory /var/lib/node_exporter/textfile_collector


Systemd systems:

Service file

cat /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter

[Service]
User=node_exporter
EnvironmentFile=/etc/sysconfig/node_exporter
ExecStart=/usr/sbin/node_exporter $OPTIONS

[Install]
WantedBy=multi-user.target


Config file

cat /etc/sysconfig/node_exporter
OPTIONS="--collector.textfile.directory /var/lib/node_exporter/textfile_collector --collector.filesystem.fs-types-exclude=\"^(nfs|autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$\""





 

Set static IP on Ubuntu

  1. In /etc/network/interfaces

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    auto eth0
    iface eth0 inet static
            address "insert the IP you want to set"
            netmask "insert subnet mask"
            gateway "insert gateway"
            dns-domain yourdomain.com
            dns-search yourdomain.com
            dns-nameservers "insert your nameservers IP address separated by spaces"

  2. Please make sure there are no "" in  /etc/network/interfaces file.

  3. Restart networking by running following command:
    sudo /etc/init.d/networking restart

  4. Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

Set STATIC IP on Fedora 21

  1. From ip link show command, find the network interface you want to make static.

    [0]ip link show
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: em1: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
        link/ether 2c:27:d7:2b:ee:76 brd ff:ff:ff:ff:ff:ff

  2. In /etc/sysconfig/network-scripts/ifcfg-em1

    TYPE="Ethernet"
    DEVICE="em1"
    ONBOOT="yes"
    NM_CONTROLLED="no"
    BOOTPROTO="static"
    IPADDR=172.17.172.79
    NETMASK=255.255.252.0
    GATEWAY=172.17.172.1

  3. In /etc/resolv.conf

    search yourdomain.com
    nameserver 172.xx.xx.xx
    nameserver 172.xx.xx.xx

  4. Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

How to Install PasswordSafe on Fedora 21




Note: I tried to install PasswordSafe on Fedora 20 but it was not able to resolve dependencies. Finally succeeded on Fedora 21.
  1. Download .rpm from - http://sourceforge.net/projects/passwordsafe/files/Linux-BETA/0.95/
    I downloaded pwsafe-0.95.1BETA-3.x86_64.rpm
  2. Switch to root and copy the .rpm file to /root
  3. Run "yum -y install pwsafe-0.95.1BETA-3.x86_64.rpm"
    It resolved dependencies and installed them
    wxBase3.x86_64 0:3.0.2-2.fc21
    wxGTK3.x86_64 0:3.0.2-2.fc21
  4. Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

VNC copy paste not working between client and VNC session

1. For windows XP run C:\Windows\System32\clipbrd.exe
For Win 7 / 8 where clipbrd.exe is missing, you can download it from here - http://www.thewindowsclub.com/downloads/Clipboard-Viewer.zip?e42721

2. Make sure vncconfig is not not running.

3. Add vncconfig -nowin -poll=500 & in your xstartup file. For linux your xstartup file will be under ~/.vnc/xstartup

This should work.

Top things to be aware of after upgrading to iOS 8

  1. Monitor your phone battery usage by App.
    Find the bad apps :)
    Settings -> General -> Usage -> Battery Usage
     
  2. Settings -> Privacy -> Location Services -> Share my Location is turned ON by default.
    • This will share you location with your Friends/Family members in Messages and Find My Friends apps. Truning this off will save your battery.
       
  3. Location-Based iAds
    Settings -> Privacy -> Location Services-> System Services -> Location-Based iAds is turned ON
    • If ON then it will serve you location based Ads in Apps instead of generic Ads. Truning this off will save your battery.
    • This is how my current System Services locations settings are.


    •  
  4. Turn off email PUSH.
    This is one of the biggest battery "drainer". Settings -> Mail, Contacts, Calendars -> Fetch New Data
    Turning Push to OFF will save lot of battery. You can always move important work email accounts to check periodically instead of Push.
     
  5. Limit Ad Tracking
    Settings > Privacy > Location Services > Share My Location
    Turning this off will "limit" not prevent from tracking for Ads. Turning this On will help.
     
  6. Turn OFF location tracking apps.
    Settings -> Privacy -> Location Service. Turn off apps like Facebook, Twitter and other apps which uses your GPS location in background. You can leave apps like google maps to serve you directions while driving!
     
  7. Installing App updates automatically like Android
    Settings -> iTunes $ App Store -> Updates.  Turning this ON will download App updates automatically.
     
  8. Hey Siri
    Settings -> General -> Siri. Turning this ON will enable your phone to activate Siri when you speak "Hey Siri" without press and hold the home button. Note: this will work only when your phone is plugged in.
     
  9. Adding 3rd party keyboards system wide.
    Settings -> General -> Keyboards -> "select the 3rd party keyboard you want to apply system wide."
     
  10. Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

I'll add more as soon as I find it.
Ask me Qs related to iOS8. I'll learn a lot from your questions related to iOS.
Enjoy iOS 8.

No sound in Fedora. Fix sound in fedora20

1. lets find the output sources we have.
$ aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0


2. Now we know the card# and device#. I want to use Logitech as my default output source so let me test it by outputting the stream to that source by running below command.

aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Right.wav           #0,0 is card 0, device 0 for Logitech

3. Determine the index of the above source by running below command.

pacmd list-sinks | less            # don't run this command as root as you will not find any source. For me it was 4


4. Lets append following 2 lines in /etc/pulse/default.pa

load-module module-alsa-sink device=hw:0,0            #0,0 is card 0, device 0 for Logitech
set-default-sink 4                       #4 is the index of the source i got from step 3

5. Restart the computer and you will have your sound fixed.
 
Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

[source - https://wiki.archlinux.org/index.php/PulseAudio/Examples#Defaulting_an_Analog_Output_Source]

Install utorrent in ubuntu

I have following:
Ubuntu version -> 12.04
Utorrent version tar.gz file -> utorrent-server-3.3-debian-6.0-i386-30235.tar.gz


Install libraries just in case if you have not installed it before.
Run following commands:

1. sudo apt-get install libssl0.9.8:i386
2. sudo apt-get install lib32stdc++6

Once the libraries are installed, follow below steps to begin actual install of utorrent:

  1. Download utorrent .tar.gz from -> http://www.utorrent.com/downloads/linux
    Above tar.gz file will most prorably be downloaded in /home/Downloads folder.
  2. go to /home/Downloads and run:
    tar xvzf utorrent-server-3.3-debian-6.0-i386-30235.tar.gz -C /opt/
  3. chmod -R 777 /opt/utorrent-server-alpha-v3_3/
  4. sudo ln -s /opt/utorrent-server-alpha-v3_3/utserver /usr/bin/utserver
  5. Finally run the utorrent server
    utserver -settingspath /opt/utorrent-server-alpha-v3_3/ &
  6. Open firefox and run utorrent -> http://localhost:8080/gui/
    username: admin and password is blank
  7. Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.
Source: http://askubuntu.com/questions/104094/how-to-install-utorrent-step-by-step

Firefox asks for user name and password on internal sites

Follow the instructions below and Firefox will not splash its password prompt for internal sites.

  • Firefox version < 13
    • Open Firefox
    • In the Address bar type about:config
    • In the filter field type ntlm
    • Double click network.automatic-ntlm-auth.trusted-uris
    • In the prompt that comes up, type a list of server you want to allow, separated by a comma and a space. For example, if you wanted to allow http://company1_server and http://company2_server, you would type in company1_server, company2_server
    • Click OK
    • In the filter field type negotiate-auth
    • Double click network.negotiate-auth.trusted-uris
    • Set the same value as above
    • Click OK
    • Restart Firefox.



  • Firefox version >= 13
    • Open Firefox
    • In the Address bar type about:config
    • In the search/filter field type ntlm
    • Set network.automatic-ntlm-auth.trusted-uris to .company_name.com
    • Set network.automatic-ntlm-auth.allow-non-fqdn to true by right-clicking and selecting "toggle"
    • In the search/filter field type negotiate
    • Set network.negotiate-auth.trusted-uris to .company_name.com
    • Set network.negotiate-auth.allow-non-fqdn to true by right-clicking and selecting "toggle"
    • Click OK if present
    • Restart Firefox.

  • Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

                Windows Switch



                In
                  Right click -> New -> Shortcut

                Add following in location field

                IE with no addons
                "C:\Program Files\Internet Explorer\iexplore.exe"  -extoff

                restart windows
                %windir%\system32\shutdown.exe -r

                shutdown windows
                %windir%\system32\shutdown.exe -s

                Switch Display
                %windir%\system32\displayswitch.exe

                Safely Remove USB
                %windir%\system32\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll

                Open Word with no splash
                "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE" /q

                Open Powerpoint no splash
                "C:\Program Files (x86)\Microsoft Office\Office14\POWERPNT.EXE" /p

                Open Excel no splash

                "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE" /e


                Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

                Open Cygwin with right click. No registry edit is required.


                This tweak will allow you to open Cygwin via right click. No registry edit is required.
                Assuming that you have installed Cygwin already.

                 


                On Win 7:
                1. Download Cygwin Setup.exe and install chere package.
                2. Right click and Open Cygwin as Administrator.
                3. type "chere -i"  or "chere -i -t mintty" if you would like to use Mintty which I personally prefer.
                4. Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

                Done!

                Make command prompt like shell interactive


                1. Right click command prompt. Go to properties.
                2. Go to Options and select QuickEdit mode and Insert mode
                Make command prompt like shell interactive

                Save the changes and you are done !!
                Now  highlighting a text in command prompt with mouse will copy it.  
                Right click to paste the copied text.


                Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

                Install Padwalker on windows for EPIC - Eclipse Perl Integration

                To install Padwalker on your windows machine follow the steps:

                I have PPM Version v4.10 and ActiveState perl v5.8.9
                1. Download PadWalker-1.9.tar.gz it from CPAN http://search.cpan.org/dist/PadWalker
                2. unzip and extract it to your Perl\lib folder (should find it over here C:\Perl\lib)
                3. In command line go to the extracted folder and execute: PPM install PadWalker

                4. Please leave a comment or g +1 or share on f or share on t below if this post helped you. This will keep me motivating.

                Done!  You have successfully installed PadWalker on windows.

                download google chrome

                Google is launching the first beta of its Webkit-based browser, Google Chrome, tomorrow! September 2nd.


                Here is the Google Chrome Browser Comic book that it is used to explain the technical details of its new browser.

                Chrome makes uses of multiple processes, where each tab runs on a separate process. Unlike Firefox, if one tab freezes, Chrome can simply close that tab, not affecting the running of other tabs or the browser as a whole.

                Google has a Web site for Chrome here.

                Intel Says Low-Cost Laptop

                Intel's plan for the system, reported earlier by Reuters, comes as the company is promoting a broader effort to promote the concept of $250 portable PCs it calls "nettops." That plan is largely based around the use of a forthcoming line of low-cost microprocessor chips that carries the new brand Atom.

                Source: http://online.wsj.com/article/SB120597489390450521.html?mod=googlenews_wsj

                Things Geeks Do For Spring Break

                HAHAaa.... Some what believe in that


                11. Plays three man with eight-sided dice instead of D & D
                10. Party like it's 1999 and you have to fix legacy code for the y2k bug.
                9. Finally get around to cleaning out the keyboard
                8. Down beers at tavern in Stormwind
                7. Secretly plot destruction of jocks on beaches with orbiting laser cannon
                6. Star Trek, Star Wars and Lord of the Rings movie marathon
                5. Organize virtual coffee-stained T-Shirt contest
                4. Create a new Linux distro
                3. Enjoy better bandwidth now that everyone is out of the dorms.
                2. Road trip to Kennedy Space Center
                1. Master "Through the Fire and Flames" on Expert

                Source : http://www.bbspot.com/News/2008/03/top-11-things-geeks-do-for-spring-break.html

                lose pound

                Do simple yog breathing exercise and lose bulky pounds .....

                If anyone wants english conversion of the exercise please leave a comment. I would be glad to help you out.

                1. Kapal bharti Pranayam




                2. Anulom Vilom Pranayam

                Management and Staff

                Does management know their staff?

                On walking into the factory, the MD noticed a young guy leaning against

                the wall, doing nothing. He approached the young man and calmly said to him, how much do you earn?"

                The young man was quite amazed that he was asked such a personal question, He replied, none the less, "I earn $ 2 000.00 a month, Sir. Why?"

                Without answering, the MD took out his wallet and removed $ 6000.00 cash and
                gave it to the young man and said, "Around here I pay people for working,
                not for standing around looking pretty! Here is 3 months' salary, now GET OUT and don't come back". The young man turned around and was quickly out of sight.

                Noticing a Few onlookers, the MD said in a very upset manner, "And that applies for everybody in this company". He approached one of the onlookers and asked him, "Who's the young
                man that I just fired?"

                To which an amazing reply came of, "He was the pizza delivery man, Sir!"