blog.farhan.codes

Farhan's Personal and Professional Blog


Switched from Ubuntu-based to Fedora

tl;dr: Fedora’s debugging packages work, Ubuntu’s are out of date. Linux = Linux = Linux, whether Arch or Slackware or Ubuntu or OpenSUSE or Linux from scratch as I once did (before there were instructions!). Unless and until the kernel forks and someone decides to modify the syscall table, they all use the same basic syscalls, they typically share the same basic libraries and core utilities, etc. They’re all the same.

Read more...

Custom Kernel Modules for Chromebook

Note: I wrote this about a year and a half ago, but I refer to it all the time. Hopefully the instructions have not changed too much! Enjoy! I recently purchased a Chromebook. It’s great, it symbolizes the direction the PC market should head – inexpensive, low-powered ARM processor, defense in depth resistance to malware and simple for non-technical users. And with crouton, it functions quite cleanly as a Debian-based workstation.

Read more...

Draw this shape without picking up your pen

For many years, while in a meeting or in a moment of free time, I have tried to draw this shape without picking up my pen or drawing over the same two points twice. At best I would get 1 line away, but never completed the shape. I wanted to know if it was even possible. So I wrote some python code to try every possible combination. But, the code is below.

Read more...

FreeBSD and Linux Remote Dual Booting

The following is a quick and dirty guide on how to setup remote dual booting for FreeBSD (12.0-CURRENT) and Linux (Ubuntu 16.04). Granted, this method is slightly a hack, but it works and suits my needs. *Why remote dual-booting? I am currently developing a FreeBSD kernel module for a PCIe card. The device is supported on Linux and I am using the Linux implementation as documentation. As such, I find myself frequently rebooting into Linux to look printk() outputs, or booting into FreeBSD to test kernel code.

Read more...

My Python3 Programming Environment

UPDATE: I have since started using a very good vimrc. I recommend it over mine listed below. My only modification is that I removed all line numbers, eww. I ssh into a FreeBSD jail with everything setup. The Jail runs on code.mydomainname.com, which has an internet-routable IPv6 address – and IPv4 behind a NAT, (boo!) I have a virtualenv already built-out. (more about my pip list later) The set my ~/.

Read more...

Hotspot Hijacking & Password Capturing

There are two types of penetration testers in the industry. Those who identify risk and vulnerabilities beyond a simple Nexpose/Nessus/Qualys scan. And those who want to “win”. The job of the “winner” is to get DA on their client’s network. Great! But once they’ve gotten it, they show off. Look how much information I can get with the DA account! I can get access to these databases and these spreadsheets. Sensitive Information!

Read more...

Easytether running on ARMv7l Chromebook

Easytether is a proprietary application, so you can’t just apt-get it on a chroot’ed crouton environment. Additionally, I am not running an x86 or x64 CPU, so most of these packages will not work. Crouton mostly comes for Debian, so I downloaded the Ubuntu package. I installed the package ‘alien’. Then unzipped the deb file as follows: alien easytether_0.8.5-1_armhf.deb This will 3 tar.xz files, mostly importantly data.tar.xz. Unzip it with the following command:

Read more...

Differences between Mint and Ubuntu

I looked into the differences between Mint and Ubuntu to see which was best for me. I watched tons of videos, reviews, comparisons, ran them both for months, etc. Here’s what I learned… They’re the same damn thing. No really, they are identical. The only differences are what software comes pre-installed and some user interface prettiness. Otherwise, no difference in the underlying system at all. Literally no difference. Next question?

Adding Arbitrary XML to python-docx

I am thankful to the developers of python-docx, they did a great job, especially since OpenXML is beyond confusing. However, I have two respectful criticisms: Python-docx lacks several key features and though it is properly written…its really confusing to follow the code. Its just a few steps. Identify the entry-point, create a new tag, and append it to the document. from docx.oxml.shared import OxmlElement # Necessary Import tags = document.element.xpath('//w:r') # Locate the right <w:r> tag tag = tags[0] # Specify which <w:r> tag you want child = OxmlElement('w:ARBITRARY') # Create arbitrary tag tag.

Read more...

Convert Docx to Markdown

I needed to convert a Docx file to Markdown, but Pandoc kept giving me this obnoxious error: $ pandoc test.docx -o test.md pandoc: Cannot decode byte '\xae': Data.Text.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream However, you can use the tool unoconv to make an intermediary step to convert first to HTML and then to Markdown. $ unoconv --stdout -f html test.docx | pandoc -f html -t markdown -o test.md On Ubuntu (And other Debian-based systems I would imagine) you can get unoconv with a simple apt-get install unoconv.

Read more...
Previous Page 3 of 4 Next Page