Posts

Showing posts from 2015

Centos 7 Gnome Applications menu items don't respond, cannot click

 Centos 7 Gnome Applications menu items don't respond, cannot click   I have CentOS 7 installed with gnome. After some uptime, no items under the 'Applications' menu respond.* I can open the menus and submenus and hover over items with the mouse pointer. They will highlight correctly, but they do not respond to clicks. The items also do not respond to keyboard navigation where I can still use the arrow keys to move around the menus and highlight items, but hitting enter etc. does not launch the application/tool highlighted. Restarting the machine helps, but that seems a heavy handed solution to the problem. *With the exception of the 'Activities Overview' item This is a known issue. See here: apps-menu: Exception: can't convert event.get_time() to an integer #7 A fix is to change line 77 of /usr/share/gnome-shell/extensions/[email protected]/extension.js from:   this._app.open_ne

How To Take Screenshots On The Raspberry Pi Using Command Line

 How To Take Screenshots On The Raspberry Pi Using Command Line  1. Install scrot sudo apt-get install scrot 2. Use command line via ssh    env DISPLAY=:0 XAUTHORITY=/home/pi/.Xauthority scrot /path/to/screen.png   3. Download image via SFTP

yum access IPv6 reposotory on Centos 7

yum access IPV6 reposotory on Centos 7 The easiest way to disable IPv6   edit /etc/sysctl.d/ disable-ipv6.conf and add net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 Then issue sysctl -p If still yum trying to access IPv6 edit /etc/yum.conf and add ip_resolve=4

Daily mail statictics from postfix and pflogsumm via cron

On Centos   yum install postfix-perl-scripts create new script file mcedit /etc/cron.daily/pflogsumm.sh #!/bin/sh # Mail Statistics MAIL_LOG=/var/log/maillog MAILHOST="YOUR.HOSTNAME.COM" RECIPIENT="[email protected]" # Generate the statistics and mail the result to $RECIPIENT /usr/sbin/pflogsumm -d yesterday ${MAIL_LOG} | \ mail -s "${MAILHOST} Mail Statistics" ${RECIPIENT} chmod +x /etc/cron.daily/pflogsumm.sh Enjoy!  

Sniffing serial port raspberry pi

To sniff serial port you need - two serial ports (can be usb extension) - install this software http://jpnevulator.snarl.nl/ with this commend all data will passed between interface AMA0 and USB0  jpnevulator --ascii  --timing-print  --tty /dev/ttyAMA0 --tty /dev/ttyUSB0 -r --pass On windows I recommend: http://realterm.sourceforge.net/

Centos 7 Failed to start LSB: Bring up/down networking.

Error in logs:   -- Logs begin at lun. 2015-02-16 12:41:51 CET, end at ven. 2015-02-20 11:39:35 CET. -- févr. 20 10:11:47 localhost systemd[1]: Starting LSB: Bring up/down networking... févr. 20 10:11:48 localhost systemd-sysctl[902]: Overwriting earlier assignment of kernel/sysrq in file '/etc/sysctl.d/51-alt-sysrq.conf'. févr. 20 09:11:50 localhost network[816]: Démarrage de l'interface loopback :  [  OK  ] févr. 20 09:12:09 localhost su[1116]: (to avahi) root on none févr. 20 09:12:11 localhost network[816]: Activation de l'interface eno16777736 :  [  OK  ] févr. 20 09:12:11 localhost network[816]: Activation de l'interface eth0 :  ERREUR   : [/etc/sysconfig/network-scripts/ifup-eth] Device  does not seem to be present, delaying initialization. févr. 20 09:12:12 localhost network[816]: [ÉCHEC ] févr. 20 09:12:12 localhost systemd-sysctl[1184]: Overwriting earlier assignment of kernel/sysrq in file '/etc/sysctl.d/51-alt-sysrq.conf'. févr. 20 09:1

Using tar with parallel compression using pigz with multi cores processor

Using tar with parallel compression using pigz with multi cores processor   $ tar cvf MYDIRECTORY.tar.gz --use-compress-prog =pigz MYDIRECTORY   In a similar way, you can list the contents of the tarball like this:  $ tar tvf MYDIRECTORY.tar.gz --use-compress-prog =pigz Or you can extract the tar like this: $ tar xvf MYDIRECTORY.tar.gz --use-compress-prog =pigz  

Grep /var/log/messages by date without leading zeros

Grep /var/log/messages by date without leading zeros   date= `date --date=" yesterday " +%b\ %e`   grep $date / var / log / messages

Cisco switch - find IP connected to port

Cisco switch - find IP connected to port " sh mac address-table". This will give which MAC is connected to which port. " sh ip device tracking interface gigabitEthernet ". This will give which IP is connectd to a port. " sh ip arp " will give you a IP to MAC table

Commands from bash/shell execute with long delay

Commands from bash/shell execute with long delay to check what is going on use strace strace -r -o trace.log echo hi   Sometimes /etc/hosts is missing entry about hostname   127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 so just add your hostname in the end of localhost or just make new entry 127.0.0.1 localhost.localdomain localhost test1 test1.example.com ::1 localhost6.localdomain6 localhost6 or 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.0.1 test1 test1.example.com

Spacewalk installation problems

Spacewalk installation problems Error: Tomcat failed to start properly or the installer ran out of tries . Please check / var / log / tomcat */ catalina . out for errors . Solution: yum install geronimo-jta-1.1-api.noarch /usr/sbin/spacewalk-service restart   Error: ** Verifying certificate locally. There was a problem validating the satellite certificate: 1   The most current Red Hat Proxy Server installation process against RHN hosted requires the upload of an SSL tar archive that contains the CA SSL public certificate and the web server's key set. Generating the web server's SSL key set and CA SSL public certificate archive:     /root/ssl-build/test1.localdomain/rhn-org-httpd-ssl-archive-test1.localdomain-1.0-1.tar Deploy the server's SSL key pair/set RPM:     (NOTE: the Red Hat Satellite or Proxy installers may do this step for you.)     The "noarch" RPM needs to be deployed to the machine working as a     web server, or Red Hat Satellite, or R

How to check cisco interface index number

How to check cisco interface index number  Remotely via SNMP:  snmpwalk -c {community-name} -v 2c {IP} ifName for example: snmpwalk -c public -v 2c 192.168.0.1 ifName  Locally on Cisco device: > enable # show snmp mib ifmib ifindex

[Solved] Nagvis weather map (traffic map) and Centreon & Nagios

To fix weather maps (traffic maps) with Nagvis and Nagios & Centreon you have to fix 3 things: 1. You have to modify the code of the check script (check_centreon_snmp_traffic). In this script you have to modify the following line : printf("|traffic_in=".$in_perfparse_traffic_str."Bits/s;$warningBit;$criticalBit;0;$speed_card traffic_out=".$out_perfparse_traffic_str."Bits/s;$warningBit;$criticalBit;0;$speed_card\n"); and replace with: printf("|traffic_in=".$in_perfparse_traffic_str."Bits/s;$warningBit;$criticalBit;0;$speed_card traffic_out=".$out_perfparse_traffic_str."Bits/s;$warningBit;$criticalBit;0;$speed_card load_In=".$in_usage."%%;$warningBit;$criticalBit;0;0 load_Out=".$out_usage."%%;$warningBit;$criticalBit;0;0 traffic_In=%.2f".$in_prefix."b;".$warningBit.";".$criticalBit.";0;0 traffic_Out=%.2f".$out_prefix."b;".$warningBit.&quo

How to get a list of users logged on vsftpd ?

The easiest ways setup setproctitle_enable=YES in vsftpd.conf and you can do a ps aux on host to see connected users. also if vsftpd is PAM-enabled, set session_support in vsftpd.conf .

Selinux blocked access via SSH authorized_keys

Selinux blocked access via SSH authorized_keys How to fix selinux context ?   To fix login for users with home in /home: semanage fcontext -at home_root_t /home semanage fcontext -at user_home_dir_t /home/user semanage fcontext -at ssh_home_t /home/user/.ssh semanage fcontext -at ssh_home_t /home/user/.ssh/authorized_keys restorecon -Rv /home For users in other directory than home for example  /data/home first line because /data is separate file system (without it still did not work) semanage fcontext -at root_t /data semanage fcontext -at home_root_t /data/home semanage fcontext -at home_user_t /data/home/rarus/ semanage fcontext -at ssh_home_t  /data/home/rarus/.ssh/ semanage fcontext -at ssh_home_t  /data/home/rarus/.ssh/authorized_keys restorecon -Rv /data/home

Unexpected DDOS: Blocking China with ipset and iptables

Blocking China As Craig discusses, there's really no option but to block everyone from China. Unfortunately for me, I wasn't using ipfw as a firewall so I couldn't follow his advice. Having finally figured out how to do this I thought I'd write a step-by-step guide assuming you've not got a firewall already set up. Note ; this all assumes you run Debian. Set up iptables iptables is a firewall application for Linux and it's already installed on Debian systems. If you already have iptables set up and in use, skip this section and go straight to the ipset section. Create a file where we can declare some rules to use: sudo nano /etc/iptables.firewall.rules Inside there you'll want to paste the following: *filter # Allow all loopback (lo0) traffic and drop all traffic to

Remove little black rectangle on screen - raspberry pi

To rid yourself of the annoying little black rectangle do the following, its only a work around but it does work. Create a script, mine starts my kiosk as well so is called /home/pi/screen.sh this script should look like: #!/bin/bash startx –help while true; do chromium –kiosk –incognito –enable-plugins http://your web addresshere.html;sleep 180s;done The 2nd line is my kiosk – you probably wont need it but I put it there anyway. Then add the following line  @/home/pi/screen.sh to the file: /etc/xdg/lxsession/LXDE-pi/autostart Reboot and watch the splash screen followed by a brief black flash and then your screenly, kiosk, or whatever your running without the black rectangle.

Custom boot / splash screen - Raspberry Pi

Displaying an image during boot instead of the default command line scrolling text - custom boot/splash screen on Raspberry Pi This is based on the guide here.   This solution works but there are a few seconds of text shown before the boot image appears. To hide it edit /boot/cmdline.txt and change to: console=tty3 add  logo.nologo to see booting use alt+f3 Install fbi sudo apt-get install fbi Copy the splashscreen image to be used Copy your custom splash image into: /etc/ and name it "splash.png". Presumably the resolution to use is 1920x1080px. Create A Script sudo nano   Paste the following into the text editor: #! /bin/sh ### BEGIN INIT INFO # Provides: asplashscreen # Required-Start: # Required-Stop: # Should-Start: # Default-Start: S # Default-Stop: # Short-Description: Show custom splashscreen # Description: Show custom splashscreen ### END INIT INFO do_start () { /usr/bin/fbi -T 1 -noverbose -a /e

Centos 7 and XRDP

To install XRDP on Centos 7 the best way is : 1. install nux repo # rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm 2. Install xrdp with gnome and vnc server Install Gnome # yum groupinstall "GNOME Desktop" "Graphical Administration Tools" Install xrdp and tigervnc # yum -y install xrdp tigervnc-server 3. When  is installed, let`s start the xrdp service.   # systemctl start xrdp.service

Setup ssh keys between servers

1. Create key # ssh-keygen -t rsa 2. Copy id to other server #  ssh-copy-id [email protected] -- type password. From now on you can login without password just: #ssh server.address.com

How to mount LVM partitions from rescue mode (Fedora/CentOS/RedHat)

How to mount LVM partitions from rescue mode (Fedora/CentOS/RedHat) Boot your rescue media. Scan for volume groups: # lvm vgscan -v Activate all volume groups: # lvm vgchange -a y List logical volumes: # lvm lvs –all With this information, and the volumes activated, you should be able to mount the volumes: # mount /dev/ volumegroup / logicalvolume / mountpoint found at: http://jim-zimmerman.com/?p=587

How can I get my external IP address in bash?

 How can I get my external IP address in bash? I'd recommend getting it directly from a DNS server. Most of the answers here all go over HTTP to a remote server. Some of them require parsing of the output, or rely on the User-Agent header to make the server respond in plain text. They also change quite frequently (go down, change their name, put up ads, might change output format etc.). The DNS response protocol is standardised (the format will stay compatible). Historically DNS services ( OpenDNS , Google Public DNS , ..) tend survive much longer and are more stable, scalable and generally looked after than whatever new hip whatismyip.com HTTP service is hot today. (for those geeks that care about micro-optimisation), this method should be inherently faster (be it only by a few micro seconds). Using dig with OpenDNS as resolver: dig + short myip . opendns . com @resolver1 . opendns . com   Perhaps alias it in your bashrc so it's easy to remembe