Wednesday, October 22, 2014

Solved Forever At Last: Overheating Laptops

If you follow this blog, you may remember I've been dealing with my computer suddenly shutting down on me, and I've had a hell of a time figuring out the cause. It turns out the problem was very simple. It was not a driver problem, it was a simple matter of the computer overheating. Certain drivers and kernels were able to mitigate the issue, but I've finally solved it once and for all. This is how I did it.

I live with a guy that is an engineer. He was on the forefront of solving these kinds of problems in the '80's, and also designed a lot of heat sinks for Dell. Since I had searched the internet high and low for a solution to my computer's problem, I have to admit I did not have much faith that he would be able to help me fix it, but I was totally wrong. I took my computer apart, and he took one look at the fan and said "That thing is filthy. Get some rubbing alcohol and qtips, and clean it out." So I grabbed some 91% isopropol, some qtips, and a vacuum cleaner. I started removing the dust from the fan blades and soon realized that there was so much dust and crap stuck in the fan that it was about an inch deeper than I thought, and after it was cleaned I could stick a qtip in between the blades and hit the bottom, where before I thought that the dust was part of the fan blades. I swabbed out dust, stuck a vacuum cleaner right on top of the fan and sucked out tons of crap, and repeated until it was all gone. Then I turned on the computer, wrote a temperature monitor script, and ran as many programs as I could as once. The processor has not gotten above 50 degrees Celsius since. Prior to that, the CPU was running at about 75 even when it was idling, and the computer would overheat after any of the 6 sensors went above 91. Problem solved. So next time your laptop overheats, just look at the fan from the inside and do what I just said. You will extend the lifetime of your computer by years.

anon@linuxpc:~$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +16.0°C  (crit = +108.0°C)
temp2:        +37.0°C  (crit = +105.0°C)
temp3:        +46.0°C  (crit = +108.0°C)
temp4:        +45.0°C  (crit = +105.0°C)
temp5:        +20.1°C  (crit = +108.0°C)
temp6:        +30.0°C  (crit = +110.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +47.0°C  (high = +105.0°C, crit = +105.0°C)
Core 1:       +45.0°C  (high = +105.0°C, crit = +105.0°C)

Sunday, October 12, 2014

OpenVPN-- Creating a Secure Portal to a Private Network With NO Port Forwarding!

If the title of this post got your attention, you are probably well on your way to building your own insane digital empire. OpenVPN is key here, and it's awesome, free, and open source (of course!). Us *nuxers are pretty familiar with Virtual Private Networks and the security and convenience that they provide. Many of us have several different VPN's (at least I do) running on different servers across the globe. This allows one to have multiple virtual identities, and in turn to keep the prying eyes of the NSA just that much more confused when they try to track us down. It also obviously allows you to be on the same private, secure, and (virtually) local network as another machine you may with to access.

Of course, out of all the networks in you arsenal, the one that you ought to be most concerned about is your home network. Now, if I had the money, I would set my Verizon Cable Modem on fire, purchase a secure modem to replace it, and another access point, a network bridge (to allow incoming connections to my home server but not the rest of my home network) a Raspberry PI with two Gigabit ethernet ports (running IPCop) to act as a firewall, and God knows what else. THEN I could safely run yet another ovpn network from my home. But I really don't want to deal with all of that... which is why I use openvpn to begin with.

Okay, let's back up a bit: So, I have a server at home, and it is acting as maybe a  media server, home-security system control panel, and maybe some other stuff that you do NOT want accessible from the outside world. But what if I want to be able to access this server when I'm on the road? Well, I could open up a port on my crappy spyware-infested Verizon router, but that would not be very secure because it only has a stateful firewall, and these days you need a firewall capable of doing application-level-inspection if you are going to allow outside access to a secure network (like the one at home). So that idea is out...

Today I discovered a solution. I simply connected my home server as a client to one of my remote VPS server's VPN's. I had to tweak the server configuration to not route all of my home servers traffic through the VPN, because that would make my home server useless while I am at home. Then I configured the IPTables on the home server to allow access to http, ssh, ect over the VPN... and eureka! The server is now accessible, remotely, via my remote VPN, and there are no open ports on my home network! Fucking right.

Saturday, September 27, 2014

SSH Port Forwarding Magic: Dynamic Port Forwarding Managment Script

For those whom are "in the know", you can skip reading this section. If not, then I am about to reveal an awesome secret to you. SSH stands for "Secure Shell" and is something that Linux users use everyday. It's pretty freaking badass and it's got lots of tricks up it's sleeve that many are not aware of. Okay, let's backup:

SSH (a secure shell) is a protocol to remotely, and securely access and control a *nix system. For instance, when I am maintaining my web server located in Switzerland, I don't travel to Switzerland to do so, I just access the server via SSH. But, what if I actually am in Switzerland and want to listen to some music on Pandora?

I'm going to get a "restricted" message, and no music, because Pandora (for whatever reason) only allows users with a United States IP address use their services. So, what to do about it? Well, one of my favourite things about SSH is that you can turn it into a quick, secure, and effective proxy server!

ssh -C -D 8080 user@host 

If you have a computer back home in the United States, then you can simply set your browser proxy settings to localhost:8080 and you can now listen to your music!

Okay, this next section is not for newbs. This is a script I wrote this morning to manage ssh port forwarding. It gives you the option of either:

1) Simply connecting to a shell,
2) Get a shell, but with port forwarding enabled,
3) No shell, just port forwarding, and runs as a daemon (in the background). This option also disables command execution for security reasons, because if you only need a proxy and not a shell to begin with, why risk it?

Enough explaining, here is the script:
###########################################
##  SSH Port-Forwarding Manager          ##
##  Author Chevis Young                  ##
###########################################
## Toggle SSH Port Fowarding:on, off, or ##
## as a silent daemon in the background. ##
###########################################

#/bin/bash
##Define Constants (ssh variables)  ##
SUSER=user     ##unix username
SHOST=host.example.com    ##remote host
SPORT=2222     ##ssh port
LPORT=8080     ##local port to forward
IDENTF=~/.ssh/id_rsa_whatever   ##identity file if needed

OPTIONS="Shell Proxy Daemon Quit"
select opt in $OPTIONS; do

if [ "$opt" = "Proxy" ]; then


echo "Shell with port forwarding requested, Set browser proxy settings to localhost:$LPORT socks 5"
ssh -i $IDENTF -p $SPORT -C -D $LPORT $SUSER@$SHOST

elif [ "$opt" = "Shell" ]; then

echo "No Port Forwarding Requested, executing shell..."
ssh -i $IDENTF -p $SPORT  $SUSER@$SHOST

elif [ "$opt" = "Daemon" ]; then
echo "Daemon mode requested, Set browser proxy settings to localhost:$LPORT socks 5"
ssh -i $IDENTF -p $SPORT -f -N -C -D $LPORT  $SUSER@$SHOST

elif [ "$opt" = "Quit" ]; then
echo Goodbye
exit


else
echo

echo -e "
  #################################################
  ## OPTIONS:                                    ##
  ## 1 Shell: Just give me a shell!              ##
  ## 2 Proxy: Shell+Port Forwarding on $LPORT.   ##
  ## 3 Daemon: No shell, just a proxy on $LPORT. ##
  ## 4 Quit!                                     ##
  #################################################"
fi
done

Tuesday, September 9, 2014

Yes Pandora, I'm still f*cking listening!

Do you want to know a secret? Pandora radio is awesome, and it's used by a many people. But, over time Pandora has added annoying disfeatures such as asking if you're still listening, and playing advertisements. Nothing breaks the mood of music like a radio commercial... it just messes up the vibes. Of course, you can pay a fee and avoid all that, or you can do this:

I stumbled across this line of  javascript a while ago, here is the source and authors page. I can't remember the author but I love it. Copy and paste this as a bookmarklet, and save it. Visit pandora.com, wait for it to load and start playing, and click the bookmark.

javascript:var%20imListening%20=%20function(){$('.still_listening.button.btn_bg').click();setTimeout(imListening,1000);return%20true;};%20if%20(imListening())%20alert('Thanks%20for%20listening!');

It will automatically click "Yes, I'm still listening." It's great, you get endless streaming music. However, you need Firefox, because the other half of the equation is Adblock Plus, a Firefox extension.  Addblock Plus blocks all of the advertisements on Pandora. So, you get the benefits of paid Pandora for the price of nothing, which is the way it ought to be. No commercials, endless music. Enjoy.

Tuesday, September 2, 2014

Dogecoin revisited... Such Currency... Wow.

Ah, dogecoin... where to begin? Many transaction, much worthless, such awesome. Doge is currently worth $0.14 per 1,000 coins. At its peak last December, it was worth around $400.00 per 1 coin. It was one of biggest pump and dump schemes ever. Wallstreet was claiming Bitcoin would reach $98,000 per coin within a year, ironically around the same time that they were getting in on it, and the price went up to $1200 per coin. Litecoin reached $45 per coin, and the future looked bright for scrypt miners... And then the FBI's two years worth of hard work paid off (at a cost of millions of dollars, I'm sure) , and Silk Road was shut down for about 3 weeks before SR2 popped up (with new features, improved security, and cheaper drugs), thus rendering the feds efforts useless. Not to mention the plethora of darknet markets to spawn since... should have left DPR where he belonged.

Right, so with SR1's fall, BTC suffered as well. Litecoin is now worth maybe $5 a coin, and the mining difficulty is stupid high, so ordinary people cannot partake. But what about Dogecoin? The difficulty is still low, but then again; the price is lower. I tried CPU mining doge for a few days and in the end earned nothing. I suppose if I purchased one of those scrypt miner ASIC's I could return a profit, but I'm not even sure if the Dogecoin developers take their own thing seriously.

Lately I've figured out that mining coins today is for suckers (or billionaires), but trading various crypto-currencies can be very profitable. I've made ~ $30 in the last three days by purchasing random whatever coins (Maxcoin, Primecoin, Darkcoin, ect) and watching different exchanges for high buy offers. If you explore the smaller coin exchanges, you'll often see buy orders for 2 or 3 times what the coin is currently worth. So, I just keep a small amount of bitcoin in a couple different exchange accounts, buy whatever-coin when it's low, and then sell it when some ignorant fool is looking to spend more for the coins he's trying to buy. Think of it like being the exchange middle-man. I spend 10 minutes looking for a high bid on (for example) the unfortunately named PPC (peercoin), and buy some at whichever exchange it's cheapest at, and then send those coins over to the other exchange, make the sale, and finally convert the prophits back into... Bitcoin!

I'm not going to give away my real money maker sites, but I will tell you that you can buy cheap alt-coins at cryptsy.com and bter.com. I can confirm that these two exchanges are legit and won't steal your money. I leave it up to you to find other exchanges to sell the coins for profits. Happy trading.

Wednesday, August 27, 2014

My Lame Dogecoin CPU mining experiment...

With all these new cryto-currencies popping up, I just had to try it. I figured I'd try to use all the extra CPU power in my arsenal of extra unused laptops, servers, unused VPS's, ect, to mine some altcoin (alternative cryto-currency coin). What's the worst thing that could happen?

I really wanted to mine Litecoin, because it's the most valuable second to Bitcoin. Well, it did not take long to figure out that the difficulty on the LTC network is just way too high to ever bother with CPU's again. Next I tried Dogecoin, which is one of the newer ones, and is not worth much. It started as a joke and for some reason got popular and is worth like $0.00002 per coin. I put my really powerful 8 core VPS server to work, along with my unused compaq laptop (dual core amd, useless Nvidia card), and a couple 2ghz cheap VPS servers. I mined in a pool for 2 days and accumulated 30 dogecoin, which is approximately equal to $0.00... (10,000 doge is worth about a $1). During that time the plastic on the bottom of my cheap compaq started to melt from heat, so I had to put it next to my window fan. Then I received an angry email from one of my VPS providers complaining that my CPU had been at 100% for 3 days straight, and told me to stop mining. I pulled the plug on that one and installed cpulimit on my other two VPS's, and set it to only use 75% of the CPU so maybe they would not notice. After two more days of this nonsense, I realized I could trade .005 BTC (worth about $2 or $3) for 21,500 dogecoin. I did that, and shut down all my miners. All in all, I mined about 40 dogecoin, and then realized that the pool would only let me cash out at least 150 at a time, and charge a "50 doge 'transaction' fee." ... pointless.

Well, hopefully the price of dogecoin skyrockets (dubious, but possible). What will I do with them in the meantime? Well, they can be used as bounty rewards for getting answers to questions on Reddit! I don't know, I just had to buy them so I could stop compulsively burning out CPU's for nothing.

What next? Well there's this new really interesting coin, Darkcoin, which is supposed to be an anonymous coin, claims it's 'darksend' feauture fixes some of the problems that Bitcoin has with transactions being easily traced on the blockchain. Not to say that you can't be anonymous with bitcoin, you can be with ease, but it does take some effort and knowledge. Anyway, I'm trying to figure out to mine that. It's supposed to be a good CPU candadite, and if darksend is what it's supposed to be, that coin could have a future. Who knows.

Wednesday, August 20, 2014

HP Probook Random Shutdown Update

In my last post I talked about a possible fix for the HP Probook 45xx random shut-down issue. Basically, the computer would shut down randomly, and I was unable to determine the cause for some time. I suggest updating the graphics drivers, as Intel now offers open source driver support for Linux users.

Although the driver update did help, it turns out that the issue was not entirely fixed. About a week after that blog, it started happening again, albeit less often. I've probably had about 12-15 random power-off's since then. I realized that it happens when performing resource-intensive tasks, in particular graphics related tasks. So this led to me to back to the graphics drivers. It turns out the Intel driver is tainted:

anon@linuxpc:~$ dmesg | grep taint
[    2.134771] drm: module verification failed: signature and/or  required key missing - tainting kernel
[    2.135831] drm: module has bad taint, not creating trace events
[    2.158791] i915: module has bad taint, not creating trace events



I then realized that my computer has been running a lot hotter than it was a couple months ago when I first acquired it, so I started monitoring the temperature while doing different things. As it turns out, when playing high definition video via Adobe Flash, things started to get really hot, with both processor cores running at 80 degrees Celsius, and the power supply running at about 90C. I figured that the computer was probably simply shutting down due to overheating, as every HP computer I've ever owned had that problem at some point.

Since I don't have any duster cans lying around, I grabbed my trusty little Phillips-head and a vacuum cleaner, then got to work. Following standard procedure, and the service manual , I took the computer apart and simply vacuumed all the dust out of the heat-sink, motherboard, and everywhere else I could see dust. If you attempt this, please be careful and be sure to ground yourself to protect your hardware from static electricity. This I accomplish by wrapping a copper speaker wire around a screw and sticking it into an outlet ground, and then wrapping the other end around my wrist.

After the vacuum treatment, I monitored the temperatures while performing various resource intensive tasks, and the temperatures of either core never got above 60 degrees C, and every other sensor was much lower than it was previously. Here is the current output of sensors:

anon@linuxpc:~$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +16.0°C  (crit = +108.0°C)
temp2:        +54.0°C  (crit = +105.0°C)
temp3:        +50.0°C  (crit = +108.0°C)
temp4:        +48.0°C  (crit = +105.0°C)
temp5:        +26.2°C  (crit = +108.0°C)
temp6:        +45.0°C  (crit = +110.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +51.0°C  (high = +105.0°C, crit = +105.0°C)
Core 1:       +48.0°C  (high = +105.0°C, crit = +105.0°C)


Definitively in the normal range again! I really hope that this solves the shut-down problem for good. I'll update again in a week or so. By the way, I think it's better to use a vacuum cleaner rather than compressed air, because I once wrecked a computer using duster. All it did was blow the dust further into the internal components, making the problem worse. A vacuum does the opposite. Perhaps this method will become the preferred method for minor dust removal. Happy hacking!