2016-11-16

building Canon MF3010 driver on Fedora25

Building Canon MF3010 driver from source, download the source from http://support-in.canon-asia.com/contents/IN/EN/0100270810.html for UFR II/UFR II LT Printer Driver for Linux V3.20 .

[ritesh@x230t SPECS]$ diff -Naurp cndrvcups-common.spec.orig cndrvcups-common.spec
--- cndrvcups-common.spec.orig 2016-11-16 14:37:13.341877857 +0530
+++ cndrvcups-common.spec 2016-11-16 14:34:40.674461102 +0530
@@ -1,5 +1,6 @@
 %define VERSION 3.60
 %define  RELEASE 1
+%global __requires_exclude ^libcaiousb.so$

 %ifarch x86_64
 %define libs32 /usr/lib
@@ -19,6 +20,7 @@ Vendor: CANON INC.
 Group: Applications/Publishing

 Source: cndrvcups-common-%{version}-%{release}.tar.gz
+Patch0: cndrvcups-common-gmodule.patch

 BuildRoot: %{_tmppath}/%{name}-root

@@ -27,6 +29,8 @@ BuildRoot: %{_tmppath}/%{name}-root
 %prep
 %setup -q

+%patch0 -p1
+
 cd buftool
 ./autogen.sh --prefix=%{_prefix} --enable-progpath=%{_bindir} --libdir=%{_libdir} --disable-shared --enable-static


For Fedora25, gmodule needs to be added to build dependency
 
[ritesh@x230t SPECS]$ cat ../SOURCES/cndrvcups-common-gmodule.patch
--- cndrvcups-common-3.60/cngplp/configure.in 2014-12-05 15:26:04.000000000 +0530
+++ cndrvcups-common-3.60/cngplp/configure.in 2016-11-16 14:17:32.517073588 +0530
@@ -11,7 +11,7 @@ AM_PROG_CC_STDC
 AC_HEADER_STDC
 AM_PROG_LIBTOOL

-pkg_modules="gtk+-2.0 >= 2.0.0"
+pkg_modules="gtk+-2.0 >= 2.0.0 gmodule"
 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
 AC_SUBST(PACKAGE_CFLAGS)
 AC_SUBST(PACKAGE_LIBS)


rpmbuild away and install. 

2016-09-01

Running Sky from tel.red on Fedora25

 
On Fedora 25, sky crash up on start in QT.
 
Program received signal SIGABRT, Aborted.
0x00007ffff112692f in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff112692f in raise () at /lib64/libc.so.6
#1  0x00007ffff112852a in abort () at /lib64/libc.so.6
#2  0x00007ffff200dcb1 in  () at /usr/lib/sky/lib/libQt5Core.so.5
#3  0x00007ffff24ee835 in QGuiApplicationPrivate::createPlatformIntegration() () at /usr/lib/sky/lib/libQt5Gui.so.5
#4  0x00007ffff24ee955 in QGuiApplicationPrivate::createEventDispatcher() () at /usr/lib/sky/lib/libQt5Gui.so.5
#5  0x00007ffff21cea64 in QCoreApplicationPrivate::init() () at /usr/lib/sky/lib/libQt5Core.so.5
#6  0x00007ffff24f2340 in QGuiApplicationPrivate::init() () at /usr/lib/sky/lib/libQt5Gui.so.5
#7  0x00007ffff2be62b9 in QApplicationPrivate::init() () at /usr/lib/sky/lib/libQt5Widgets.so.5
#8  0x0000000000434e41 in main ()
(gdb) quit
A debugging session is active.
 
 
Once workaround, is to let sky use the system provided qt5 libraries. 
$ rpm -q sky
sky-2.1.6327-1.fc24.x86_64
$ cd /usr/lib/sky
$ sudo mkdir old
$ sudo mv libQt5* old
$ sky


Would be nicer, if sky could use system libraries by default.



$ rpm -Uvh sky-system-qt ( meta package,installs sky and qt deps)
$ cat sky.sh
 
if shibboleet and ~/config/sky/.version is older than install
  use system library and start sky
  if start failed, disable shibboleet
else
  ld library jazz
  sky
fi

2016-08-07

installing splunkforwarder using ansible

The vars
---
  splunk_home: /opt/splunkforwarder
  splunk_exec: "{{ splunk_home }}/bin/splunk"


The playbook
---

- name: install splunk forwarder
  yum: name=splunkforwarder
       state=latest
  become: yes

# check for first time run
- stat:
    path: "{{ splunk_home }}/ftr"
  register: result_splunk_ftr_stat

- block:
    - name: setup splunk for first time run
      shell: |
        ps aux|grep splunkd && pkill -9 splunkd || true
        {{ splunk_exec }} start --accept-license --answer-yes --no-prompt
        {{ splunk_exec }} enable boot-start
  when: result_splunk_ftr_stat.stat.exists
  become: yes


# Only add servers which are not in list
# shell: /opt/splunkforwarder/bin/splunk list forward-server -auth user:pass
# register: current_fwd_list
#- block:
#    shell: "{{ splunk_exec }} add forward-server {{ splunk_server }}:{{ splunk_server_port }} -auth user:pass"
# when: item not in current_fwd_list
#  become: yes
# with_items: splunk_fwd_server

# same logic for adding logs
#    - shell: "{{ splunk_exec }} add monitor {{ item.path }} -index {{ item.idx }} -sourcetype {{ item.path }} || true"
#  with_items:  "{{ splunk_log_files }}"

and profit !

2016-06-22

adding authorized keys using ansible


You can use jinja template engine to set this

vars:
  ssh_user_key:
    - user: ritesh
      exclusive: no
      keys:
        - ritesh.centos
        - ritesh.fedora

- name: ssh user key upload
  authorized_key:
    user: "{{ item.user }}"
    exclusive: "{{ item.exclusive if item.exclusive is defined else 'no' }}"
    key: "{% for file_name in item['keys'] %} {{ key|default('') + lookup('file', file_name) }}{% if not loop.last %}{{ '\n' }}{% endif %} {% endfor %}"
  become_user: "{{ item.user }}"
  become: yes

  with_items:
    - "{{ ssh_user_key }}"
  tags:
    - setup-user-ssh-client-key



adding authorized keys using ansible


You can use jinja template engine to set this

vars:
  ssh_user_key:
    - user: ritesh
      exclusive: no
      keys:
        - ritesh.centos
        - ritesh.fedora

- name: ssh user key upload
  authorized_key:
    user: "{{ item.user }}"
    exclusive: "{{ item.exclusive if item.exclusive is defined else 'no' }}"
    key: "{% for file_name in item['keys'] %} {{ key|default('') + lookup('file', file_name) }}{% if not loop.last %}{{ '\n' }}{% endif %} {% endfor %}"
  become_user: "{{ item.user }}"
  become: yes

  with_items:
    - "{{ ssh_user_key }}"
  tags:
    - setup-user-ssh-client-key



2016-05-07

zabbix 3.0.2 for RHEL6 is built

A follow up on using zabbix30 on el6 . zabbix 3.0.2 packages for RHEL6.x64 has been pushed out.

I have switched to IUS repository, over webtatic.

phpipam behind a load balancer which handles ssl offloading


phpipam has support for ssl offloading, via X-Forwarded-For header .
  public function createURL () {
                # reset url for base
                if($_SERVER['SERVER_PORT'] == "443")            { $url = "https://$_SERVER[HTTP_HOST]"; }
                // reverse proxy doing SSL offloading
                elseif(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')      { $url = "https://$_SERVER[SERVER_NAME]"; }
                elseif(isset($_SERVER['HTTP_X_SECURE_REQUEST'])  && $_SERVER['HTTP_X_SECURE_REQUEST'] == 'true')        { $url = "https://$_SERVER[SERVER_NAME]"; }
                // custom port
                elseif($_SERVER['SERVER_PORT']!="80")           { $url = "http://$_SERVER[SERVER_NAME]:$_SERVER[SERVER_PORT]"; }
                // normal http

Unfortunately, some don't follow this or have been configured for this, which results in phpipam loading incorrectly. To workaround this issue, edit config.php

$_SERVER['HTTP_X_FORWARDED_PROTO'] = "https";


And now, back to life.


2016-03-31

python : disabling SSL verification on pyvmomi on python


  • self signed certificate ? 
  • RHEL6 ? python 2.6 and 2.7.10 mixed environment ?
  • pyvmomi 5.5+ ?

Looking for a quick fix ?
...
File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 447, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [Errno 1] _ssl.c:492: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

[root@fb7a3cd8c69d ~]# vim my_script.pyt
...
    context = None
    try:
        # Disabling SSL certificate verification       
        context = ssl.SSLContext(ssl.PROTOCOL_SSLv3)
        context.verify_mode = ssl.CERT_NONE
    except AttributeError:
        rget = requests.get
        requests.get = lambda obj, *args,**kwargs: rget(obj,verify=False)
        requests.packages.urllib3.disable_warnings()

    si = SmartConnect(host=args.host,
            user=user,
            pwd=args.password,
            port=int(args.port), sslContext=context)


And you are good to go. This will resolve the issue, and allow you to focus on your life

PS: You would still need to fix this to use basic auth.

2016-03-28

BSNL redirecting to “http://domain-error.com”

To work around this ISP spam, I have forced NM to use google dns .

cat  /etc/NetworkManager/system-connections/Auto\ Ethernet 
...
[ipv4]
dns=8.8.8.8;8.8.4.4;
dns-search=
method=auto
ignore-auto-dns=true
...


Alternatively, install and use nmtui


refence: 
https://developers.google.com/speed/public-dns/ 
https://askubuntu.com/questions/708762/redirecting-to-http-domain-error-com 
https://www.hogarthuk.com/?q=node/8 

2016-03-23

Using zabbix 3.0 on EL6

zabbix 3.0 requires php5.4 or above, and consequently is not available on EL6. To workaround this, you would need to install php562 from webtatic.

I prefer to use mariadb , with php56u on my zabbix server.  The prebuilt packages can be downloaded from copr:ritz/zabbix30

 This is a rebuild against mariadb 10.1.x, with php56-5.6.19 for zabbix-3.0.1 .

Instructions for manual install - https://www.zabbix.com/documentation/3.0/manual/installation/install_from_packages

sql scripts can be grabbed from  svn - https://zabbix.org/wiki/Get_Zabbix

2016-03-13

Using C++ REST on Fedora Linux

Microsoft has release Casablanca ( C++ REST) to github. I have pushed Fedora packages for these to copr .

Happy -lcpprest




2016-01-17

Increase the offline storage quota for Kindle in epiphany

You can install Amazon's Kindle Cloud reader as a webapp on Fedora Linux using epiphany from gnome-software.



This just leaves you with one issue, the default offline storage quota for Database is a measly 6m, which you hit real quick.





Turns out, webkitgtk3 used to offer an api webkit_get_default_web_database_quota with webkitgtk3, which has been removed from webkitgtk4 used by epiphany.

To manually update this quota, locate the folder used by epiphany in application mode for Kindle.

$ ls ~/.local/share/
...
epiphany-kindlecloud-xxx
...


Open up the Database file here, and manually set the quota

$ cd ~/.local/share/epiphany-kindlecloud-xxx/databases
$ sqlite3 Database.db
sqlite3 > SELECT * FROM origins;
https_read.amazon.com_0| 6164480
sqlite3 > UPDATE origins SET quota=102400000 WHERE origin=https_read.amazon.com_0;


And now back to life.


GitLab runner on Windows with bash shell on windows contianer on Docker

As part of your pipeline, you may need to perform browser testing across different platforms/environments. To minimize testing time, it'...