Python URL Term Scrapper (Kind of Like a Very Dumb/Simple Watson)

I wrote this a while back to scrape a given URL page for all links it contains and then search those links for term relations. The Python scrapper first finds all links in a given url. It then searches all the links found for a list of search terms provided. It will return stats on the number of times specific […]

Python TypeError: expected a character buffer object

Error I received the following python error: TypeError: expected a character buffer object The below screenshot shows my code. Solution I was using the replace method, while the better method for my situation would be to use the re.sub(patter, replace, string) method, the new line became: my_text = re.sub(comp, ‘#undef SEEK_SET\n#undef SEEK_END\n #undef SEEK_CUR\n#include ‘, f) The replace method expects […]

SSL Encryption for Django’s Local/Native Server

Django comes packaged with a lightweight python server. It is not intended to be a production server but more a testing/development host. Running the server is as easy as running the following command within a Django project: python manage.py runserver Since it’s so lightweight, it doesn’t come with the same abilities as other servers like Apache or Nginx. It can’t […]

PIR Sensor on the Pi

Today I soldered a PIR sensor to my Pi! Basically, I want it to detect movement and turn on a LCD screen, then turn the screen off again after a minute of no movement. So when I walk into a room, the screen turns on and when I leave, the screen turns off. Equipment My Pi (See early Posts) PIR […]

Type-Safe vs Dynamically Typed Programming Languages

So a lot of my posts include Python code. Python is a powerful, dynamically typed, free application programming language. Programming languages are either type-safe or dynamically typed. One setting isn’t necessarily better than the other. It all just depends on your project and what you are trying to accomplish. Type-Safe (Statically typed) A variable type (int, unsigned int, double, float, etc.) […]

Logging on Python 2.7

Something actually useful… logging! Not talking about lumber but logging code issues, data, access, anything useful in an application environment. Python makes this super easy! Logging is part of the Python standard library and can be imported with the following line of code. import logging Setup First step after importing the library is to initiate the logger.  log = logging.getLogger(__name__) #create a […]

My Ultimate Network Monitor/Enumeration Tool – Putting It All Together

Finally, all the parts come together. Look at my previous posts for all the pieces to building the LilDevil network monitor and enumeration tool. Tomato Shibby on ASUS RT-N66W Tomato Shibby Guest Wireless Tomato by Shibby Splash Page Restricting Bandwidth on Tomato Pi Time! IMPROVEMENTS: Detecting New Network Devices with Python and Tkinter Playing with the Pi: Portable Server The […]

IMPROVEMENTS: Detecting New Network Devices with Python and Tkinter

So I wasn’t too happy with the kludginess of the network monitoring tool that I posted about earlier this week. It lagged and really wasn’t an ideal tool. I decided to redesign the entire model. The new tool still utilizes Python 2.7 and consists of three parts: Ping/Enumeration Script RESTful Django Script Tkinter Reporting GUI Script Here is how they connect. […]