Skip to main content

GeoffStratton.com

  • About/Contact
  • GitHub
  • LinkedIn

Tag: Python

Python: Webscraping With BeautifulSoup

March 26, 2016March 16, 2022 Geoff Stratton Leave a comment

Some experiments in website scraping using Python 2.7 with BeautifulSoup 3.2. The first function here shows various manipulations of an HTML page, including saving a scrubbed file to disk. The second function shows a simple crawler that attempts to traverse a domain and build a sitemap from hyperlinks encountered in the pages. Includes some commentary […]

Loading

Read More

Python: Statistics Calculators

March 17, 2016March 16, 2022 Geoff Stratton Leave a comment

Some statistics calculators written for Python 2.x (the str.format() method requires Python >= 2.6). Of course you could just use the numpy or statistics libraries, but where’s the fun in that? All solutions verified where possible by Wolfram Alpha or else by EasyCalculation.com.

Loading

Read More

Python: XML-RPC Requests

March 16, 2016March 16, 2022 Geoff Stratton Leave a comment

Tinkering with Python xmlrpclib, in this case for updating a WordPress blog from the command line. Using Python 2.7.6 here. xmlrpclib is included with Python 2.7, but if you need it, install with Pip.

Loading

Read More

Python: MIME/SMTP

August 25, 2014March 16, 2022 Geoff Stratton Leave a comment

Send a MIME-encoded email in HTML and plain text using Python’s smtplib (Python 2.x). Just call ‘mailer’ with a return address, list of recipients, message subject and body.

Loading

Read More

Python LDAP Lookups

August 25, 2014March 16, 2022 Geoff Stratton Leave a comment

An example of a Python LDAP lookup, Python 2.x. This one uses the on-campus LDAP service at UC Davis, so just change the LDAPServer and searchBase for another LDAP server. Or you can print the results a little more nicely:

Loading

Read More

Migrate Zope/Plone from CentOS to Ubuntu

August 18, 2014March 16, 2022 Geoff Stratton Leave a comment

I don’t use Zope and Plone anymore, but if you’ve played with Zope/Plone you know they are highly proprietary, fragile, missing a lot of desirable functionality, and overall pretty painful to manage. About the only thing I really ever liked about them was the relative ease of integrating Python libraries and code. Regardless, I sometimes […]

Loading

Read More

About

This is the home server of Geoff Stratton. There's a little more about me on the About page. The server itself lives in Softlayer's DAL02/06 data center in downtown Dallas, Texas, geolocation 32 47 32.599 N 96 48 53.11 W 125m 10m 100m 10m.

I use this place mostly as a personal knowledge base, although I keep it public in case anything useful emerges. Caveat emptor, and don't go handling snake-skin.

Consider everything posted here to be covered by the GNU Public License Version 3. You should read the whole license, but essentially it means you can do anything you want with the code, including bundle it up and sell it as a new application. The catch is that if you make and distribute a new app, you are required to make all the source code available for free to everyone.

Tip Jar

Did you find something useful here? Please consider a tip. Many thanks!


Buy Me A Coffee


Categories

Tags

Ansible Apache awk Bash C# CentOS Debian DNS Docker Drupal Drush Fedora grep Hardware Hosting IP JavaScript jQuery LDAP Linux Mail Server mtr MySQL Nginx OTRS Perl PHP Plone Pound Python Redis sed SpamAssassin SQL SSL tcpdump TrueCrypt Tutorials ufw Varnish VB.NET Webform Windows WordPress Zope

Archives

sparkling Theme by Colorlib Powered by WordPress