Yearly Archives: 2014

Getting root access to a Raspberry Pi using the Netbeans IDE

I was recently able to assist a friend in enabling root access to his Raspberry Pi – in the event that this advice may help others as well, here it is:

My friend needed root access to work with the low level IO on the Raspberry Pi. While the username account supplied with a Raspberry Pi does have sudo rights on the Pi’s Linux OS, the Netbeans IDE he was using wasn’t able to use sudo when communicating with the Pi, complicating development. I advised him to set a known password to the Pi’s root user account and then set Netbeans to use the root account:

>> sudo su

This will now change to operating as the root user.

>> passwd

Set the password to something suitable – this will change the root user’s password. Now set Netbeans to communicate with the Pi using the username “root” and the password you chose and you’ll have full root access.

While I realise that logging into your PC as root is generally not a great idea, the situation is rather different for something like a Raspberry Pi or similar, which is already dedicated to a specific task.

Leave a Comment

Filed under code

Warwick’s Workings, part II

This post will mainly make sense to Warwick – if you aren’t Warwick and you need some context, see the Twitter thread starting with this twitter post.

u_{cost} \text{ is the number of units at cost price}
p_{cost} \text{ is the unit cost price}
u_{current} \text{ is the number of units at the current price}
p_{current} \text{ is the current unit price}
p_{target} \text{ is the target unit price}

\frac {u_{cost} p_{cost} + u_{current} p_{current}} {u_{cost} + u_{current}} = p_{target}
\Rightarrow u_{cost} p_{cost} + u_{current} p_{current} = p_{target} (u_{cost} + u_{current})
\Rightarrow u_{cost} p_{cost} + u_{current} p_{current} = p_{target} u_{cost} + u_{current} p_{target}
\Rightarrow u_{current} p_{current} - u_{current} p_{target} = p_{target} u_{cost} - u_{cost} p_{cost}
\Rightarrow u_{current} (p_{current} - p_{target}) = u_{cost} (p_{target} - p_{cost})

\text{The formula you
u_{current} = \frac {u_{cost} (p_{target} - p_{cost})} {(p_{current} - p_{target})}

\text{Proving it works using the given figures:}
u_{current} = \frac {336 * (14 - 18.23)} {(13 - 14)}
\Rightarrow u_{current} = \frac {(-1421.28)} {(-1)}
\Rightarrow u_{current} = 1421.28

Leave a Comment

Filed under Uncategorized