2016-05-07

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.


2015-07-13

Lync on Linux

If you are looking to run Lync, aka Skype on Business on Linux you are in luck. Fisil has a client for Linux hosted at http://tel.red/ .

Unfortunately, this came with a bit of a hitch. The application failed to run on Fedora 23 (rawhide). Sky is bundling its own libraries !
$ sky
/opt/sky_linux/sky: symbol lookup error: /lib64/libXxf86vm.so.1: undefined symbol: _XEatDataWords

The solution, would be to load system library
$ LD_PRELOAD=/lib64/libX11.so sky

reference:

_XEatDataWords was add to fix an issue - http://cgit.freedesktop.org/xorg/lib/libXxf86vm/commit/id=284a88e21fc05a63466115b33efa411c60d988c9


Edit: Fixed with 381http://tel.red/beta/sky_redhat64_v2.0.381.rpm ) and above.

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'...