[Fit Log] Day 4

Fit Log / Food

Last night was brutal. I had to spar for about 2.5 hours. I learnt quite a lot of things. But I also spent too much time there and had some other stuff to take care of and so missed my class and a due homework the next morning. I won't let that happen ever again. I was well within my calorific deficit but I didn't get enough fiber. I am trying to fix that but I am currenly overriden with work and homework. This is getting harder and harder everyday. I need to spend less time doing nothing and spend more time finishing homework. So today I am going to try and get more food in. Chicken and some vegetables and other things. I also have to go for a run. It helps me sleep and think. I have to clean my room and most importantly I have to study what I missed today. Also my car's light is busted and I need to fix that, so on my way home I have to go and get a Headlight bulb and then install it. I could ask my room mate to do it but he has no clue how…

[Fit Log] Day 3

Fit Log / Stronglifts / Food / Sleep

So, I couldn't get all the sleep I needed. I planned on lifting yesterday but I was too tired. It's because of IF. I think it'll take a while to get used to it. But when I do, I will probably get back in the game. Anyway, so sleep. Well, that was because the fucking apartment caught on fire. Well technically, the heater short circuited but there was an electrical fire and I had to call the fire department and as I am writing this (at work) the heater is being replaced. It's as old as the guy replacing it. But today's goal is to stay under the TDEE and get ready to go to the gym at 9:00 PM. I haven't been able to finish my VLSI homework so that will have to be done while I am eating. Which reminds me I am out of chicken. But I have fish and a load of shrimps. So I think I can heat that up. I wonder what my squat will be like. I think I might be able to squat at least 225. I'll be sore for the next couple of days but definitely 225. I'll try and…

[Fit Log] Day 2

Fit Log / Exercise / Xtend / Supplements

So last night, I wasn't able to exercise at all. There was too much on my mind. But I did go out shopping and I did walk around for a while. But nothing substantial. I was able to stay in my caloric deficit so that was good. Today though, it's going to be hard trying to eat because I have a lot of work to finish. So what I've done is, taken Xtend and Beta Alanine in my shaker bottle and am going to sip it till the end of the day. The second thing I've done is taken my BB.com funnel and filled with Beta Alanine and Body Fortress Whey (2 scoopes) because I plan on working out today. Hopefully that will give me a much needed boost to o squat. I'll update my food profile tonight and I'll update my workout for today when I get back home.…

[Fit Log] Day 1

Fit Log / Stronglifts / Motivation / Fat / Exercise / Food

So, I haven't been lifting lately. Here are my stats before I lost my motivation, roughly 3 weeks ago: squats: 235 lbs deadlifts: 250 lbs bench press: 135 lbs overhead press: 90 lbs pendalay row: 160 lbs My sparring time is roughly 1 minute 30 seconds. So yeah, I am out of shape. Now I have to attend my cousin's wedding in December so my aim is to lose substantial amount of fat in the next 3 months. Strategy? Portion control. I won't lie, Keto worked for me and it did help me out a lot but I started binging and that lead to guilt. So I don't think I will get back into Keto this time, even though it looks very attractive. I can think about it in the final few days to lose that last bit of water weight but not right now. Regular running. The thing that I've been trying to get into for the longest time is running. It's amazing but my schedule doesn't let me do it consistently. I am taking 4 courses this semester and that doesn't give me all the time that I need. But this time I am going to take out…

USB Wifi dongle on Beaglebone Black & Ubuntu 14.04 (RTL8192cu driver)

Hardware / Ubuntu / LInux / Tutorial / Wifi / Beaglebone Black / Trusty / RTL8192cu / Realtek

After an extremely long hack session I finally got RTL8192cu to run on Beaglebone Black A5C/A6 running Ubuntu 14.04. It was painful. But here is a log of my experience with it. Step 1. Installing Ubuntu 14.04 (flashing eMMC) This is the process. Download the image to your sd card and then burn it to the eMMC. Warning: You will need to connect to the internet first using eth over USB or the ethernet port. Step 2. Update & Upgrade $ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get install build-essential git vim linux-headers-generic linux-headers-`uname -r` Step 3. Build the realtek 8192cu kernel module Clone the repo here. $ git clone https://github.com/cmicali/rtl8192cu_beaglebone.git $ cd rtl8192cu_beaglebone $ make CROSS_COMPILE="" Step 4. Put the module into the appropriate directory This will build the module. Now you simply take it and put it in /lib/modules $ sudo mv 8192cu.ko /lib/modules/`uname -r` $ sudo depmod -a $ sudo sudo vim /etc/modules Add 8192cu to the list and the file is probably empty. Save the file. # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should…

[Dev Log] Python Kivy: Part 1

Python / Dev Log / Ubuntu / Kivy / Android / LInux

I am trying to get a hang of Kivy, the cross platform Python UI kit. It looks stable and there are some really good examples out there. The good thing about this particular project is that when they say crossplatform, they mean cross platform. That's got me real excited. I can create apps on my linux machine and deploy them on Android. That's the part I am psyched about. So let me keep a track of what needs to be done. It's generally a good idea to log your progress :). Okay so my distro is Ubuntu 14.04 and here's what I did to install kivy: $ sudo add-apt-repository ppa:kivy-team/kivy && sudo apt-get install python-kivy kivy-examples Yeah, I am a sucker for stable code. There's more info on how to install it on their installation page. Anyway, so once I installed all of that I copied the examples into /usr/share/kivy-examples by doing this: $ python -c "import pkg_resources; print(pkg_resources.resource_filename('kivy', '/share/kivy-examples'))" I then made an alias to the directory, because I was having issues creating a symlink. I am sure symlink can be created using nautilus but I found this to be…

[Dev Log] Knock : Part 6 - My massive mistake

Django / Python / Knock / Hardware / Dev Log / AVR / ATMEL

So I used ATTiny2313. For a project that depends upon Analog To Digital Conversion. I USED A CHIP THAT DOESN'T HAVE AN ADC. But the good thing is it took me 6 hours to create a new board with ATMega88A-PU. Oh did I mention I got the ATMega88A-PU instead of the ATmega8 btw? Yeah, I did that too. Jeez, I need to be more careful. Anyway I had the new board up and running within 6 hours (I did sleep for 8 hours in between the 6 hours so if it makes any sense, it took me 14). I have the piezo and a photoresistor soldered on it. No more messing around with interrupts for now. Just ADC and serial. I haven't gotten around to writing the ADC program yet. But I tested the blinky.c file. Makefiles make everything easier. On a completely different note, I've made my first official Django app called Django-Associations. It has had about roughly 1.5K downloads. I am so happy! I will put in the dev log for that too. But for right now It's going to have to wait because I am working on Knock. What a goddamn mess. I need to…

[Dev Log] Knock : Part 5

Knock / Hardware / Projects / Dev Log / AVR / ATMEL

Serial on an 8 bit controller is hard to grasp. Especially if you're working in C. I mean you've got to take care of memory etc. So yeah, it's a bit annoying. No wonder Arduino was born. But hey, after much tinkering I finally did crack the code, so to speak. I had some help from the EvilMadScientist code. So here's my progress. /* Author: Pronoy Chopra Description: Serial implementation and test. */ #define F_CPU 8000000UL /*Using the internal clock with 8 prescalar*/ #define BAUD 9600UL #define BAUD_PRESCALE ((F_CPU / 16 / BAUD) - 1) #include <avr/io.h> #include <util/delay.h> #include <util/setbaud.h> void SerialWrite(unsigned long Data) { while(!(UCSRA & (1 > 8); UBRRL = BAUD_PRESCALE; //UCSRA |= (1 So when I configured pyserial to receive data from the controller, I received \x00 instead of the 'A' that I sent. It took me a while to realize that the compiler was throwing warnings. The BAUD and F_CPU were supposed to be configured as unsigned long types so the UBRR calculation wasn't correct. Now, when I fixed this, it worked just fine. So that's a good lesson. Heed the compiler's warnings yo. The…

[Dev Log] Knock : Part 4

Python / Knock / Hardware / Projects / Dev Log / AVR / ATMEL

AVR USART So I've been working with AVR USART today and I talked to some of the guys on #avr on freenode. Turns out _BV() is not a good way to do things. It was a hack apparently that was used by people before GCC was fixed. I didn't get too much into what was fixed but good practices are good practices so I am going to start putting values into registers using bit shift. Example: UCSRB |= (1 …

[Dev Log] Knock : Part 3

Python / Knock / Hardware / Projects / Dev Log / Ubuntu / AVR / ATMEL

So I am lazy and I like working on a linux environment. Don't get me wrong I love the Atmel Studio, it's got a lot of stuff, it's easy to use and it's got a great programming/debugging tool. But command line has its own charm. So here I explore/log how I programmed a custom board using AVR ISP MKII. Toolchain Ah Mac OS X. You're so silly. Almost makes me want to punch you in the face. But, I won't, you're expensive and you have a great package manager called Machomebrew. So I simply used it and did this DarkSector@DarkBook:~$ brew update DarkSector@DarkBook:~$ brew install libusb avr-binutils avr-gcc avr-libc avra avrdude Sweet, that went well. Now simply to go and write the code and generate the .hex or .elf files Compiling and linking AVR GCC, like the normal GCC follows the normal procedure of compiling linking etc. So this is the ATTiny2313 blink code and the set of commands to generate the hex file //blinky.c //Author: DarkSector #define F_CPU 1000000UL #include <avr/io.h> #include <util/delay.h> int main(void) { DDRB |= _BV(DDB4); while(1) { PORTB |= _BV(PORTB4); _delay…

[Dev Log] Knock : Part 2

Python / Knock / Hardware / Projects / Dev Log / AVR / ATMEL

So today I did two things. I set up the local server and I also soldered an ATTiny2313 onto a protoboard. The amazing part is that I got the board working the first time around. I was concerned for a while, how I did that. If it works the first time, something's about to blow up. Well, not really, but you can't trust electronics. Anyway, so here's the log for today Ubuntu Desktop 12.04 with Edimax EW-7811Un I admit I was frustrated two fold because first I didn't receive my WiFi dongle due to the holiday season and then when I did receive it, it didn't work out of the box. You can see the dongle detect all wireless networks, but you won't see it connect to the ones you want. So, conclusion: you need Realtek drivers. RTL8192CU. Anyway so I installed the drivers after downloading the Ubuntu OS update. Now this machine has only 512 MB of RAM and is a Compaq Presario. Remember those? Yeah, I have that as a server. It's not to bad though. But it did take some time to build. Anyway, rebooted machine after installing the drivers and it worked like a charm…

[Dev Log] Knock : Part 1

Knock / Hardware / Projects / Dev Log / Ubuntu / AVR / ATMEL

So I got my stuff on a Sunday. UPS really outdid themselves and awesome packaging my Digikey. Now I know who I am going to be ordering my stuff from, all the time. Interestingly Amazon is late. I understand not many people want eval boards for christmas. Anyway time to get onto the architecture. Let's start off with a diagram/mind map. So, the piezo is connected to the controller and the controller is connected to the server over an FTDI cable. The clients are connected to the network and so is the server. So, I am gonna have a Flask server listening to the clients' requests and whenever the request is made the server checks if there is any change in the incoming data. I can see some potential problem though. Since the client is gonna poll the server, there are gonna be a lot of requests. The requests are gonna land up in a certain window of time that may or may not coincide with the time data is incoming on the Serial port. So, the data window has to be extended. This implies the data coming from the controller has to be padded with the last known…

Knock : For the ones with headphones on all the time.

Knock / Hardware / Projects

Project Knock is my first personal hardware project after a long time. I haven't actually begun putting together the hardware right now, because it's not arrived yet. Waiting on UPS to deliver stuff that I ordered from Digikey. I am going to be doing it on AVR (no surprise there), ATTiny2313. I've created the repository and I intend to create the server on Ubuntu. The client is going to be Mac OS X 10.9 for now. Both, my roommate and I always have our headphones on and we miss most of our deliveries because we can't hear if anyone's knocking. So this is the solution. To get notifications on our Macs when we are working. Win. The project repository can be found here https://github.com/DarkSector/knock Here's the developer log for the whole project…

Deploying Django on Nginx using Gunicorn, Postgres and Supervisor

Django / Python / Migration / Nginx / Web / Gunicorn / Old Data

So I finally built my blog on Django. I've been working on this for quite a while. My code is on a private repository on Bitbucket right now because I have my production settings file in the open. Once I clean that up I'll make this repository public. So this time I am using Nginx instead of Apache as a web server. They both have their merits but I decided to go with Nginx because to me it seems much more easier to configure than the latter. I recently acquired a VPS on DigitalOcean and it's been great. It's cheap, fast and they have really good documentation. I am also using Gunicorn instead of mod_wsgi because I've had some really bad experiences with mod_wsgi on CentOS when I was working with IIT a year back. Gunicorn is directly integrated within Django so that makes things easier. Anyway, so this is how I did it. Installing Postgres and configuration So instead of using sqlite3 I am going to be using Postgres because of South compatibility. Since this is a low traffic website. I am hosting the DB Server on the same server instance. I simple followed the guide given…

Migrating from Django datastore

Django / Python / Migration

I moved to Ghost. Now I have to get the posts that I wrote using Django for my previous deployment. I am going to have to dump data here and then modify it and add markdown. That's going to be fun. Not.…

Welcome to here. I have no idea what I am doing.

First Post

So looks like it finally happened. I am now live on Ghost the blogging platform. It was just too pretty to avoid. I do however have to have it on a separate server instance I purchased from Digital Ocean. If you don't know about them, you should definitely check them out. They're awesome. Anyway, so what's up with me? Thanks for asking. Well, Django, AVR, Wireless Sensor Networks, JS a lot of C and a hell lot of planning. I am currently in my last semester (or so I hope) for a masters in Electrical & Computer Engineering degree at the University Of Oklahoma. This semester is not only crucial but incredibly hectic. I have to take about 4 courses that's 12 credit hours on top of my job as a graduate assitant at OU (I love my job). But it is going to be very difficult juggling them around. Once I am done here, the plan is to try and make a move to Colorado to help start a startup. Things will start to take shape in the next few months so I need to manage my time with that particular project too. As it so happens, that may…