Skip to content

Instantly share code, notes, and snippets.

View kngeno's full-sized avatar
🎯
Focusing

Kipyegon Ng'eno kngeno

🎯
Focusing
View GitHub Profile
@kngeno
kngeno / tomcat8_restart_service.sh
Created November 10, 2019 17:33
A bashscript to restart tomcat8 using a cronjob
#!/usr/bin/env bash
URL='https://<url or domain>/geoserver/<workspace>/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonode:ken_adm&maxFeatures=50&outp$
# only output error messages
curl -s -S -f $URL > /dev/null
if [ $? -ne 0 ]; then
date
echo Restarting Tomcat8 service
@kngeno
kngeno / email_attachments_download.py
Last active October 17, 2023 08:37
A python script to download email attachments from specific email addresses
"""
Python 2.7/3.6 compatible
GMAIL Accounts
A script to download email attachments from specific email addresses
Please edit the following details to work:
YOUR_EMAIL_ADDRESS
YOUR_EMAIL_PASSWORD
LABEL - Inbox, Trash, Archive, ...
RECEIVING_EMAIL_ADDRESS
RECEIVING_SUBJECT - '*' for all OR 'Title of Subject'
@kngeno
kngeno / proxy.cgi
Created December 29, 2015 13:38
proxy.cgi
#!/usr/bin/env python
"""This is a blind proxy that we use to get around browser
restrictions that prevent the Javascript from loading pages not on the
same server as the Javascript. This has several problems: it's less
efficient, it might break some sites, and it's a security risk because
people can use this proxy to browse the web and possibly do bad stuff
with it. It only loads pages via http and https, but it can load any
content type. It supports GET and POST requests."""
import urllib2
import cgi