Sunday, November 23, 2014

Creating a Windows/Linux Dual Boot System

Not that there is a shortage of this kind of information, but for those of you whom either cannot or will not convert from Microsucks, Windows to the awesome GNU/Linux platform, this post may help you out. Since I am currently doing exactly that, I'm going to blog the process, for the hell of it, so to speak.

Making the switch to Linux from Windows is generally pretty painless. However, there can be some minor, and irritating issues that must be addressed. In one case, the first words out of my clients mouth were "Eww I can't use Netflix?" ... Yes, you can totally use Netflix with Linux. Because Netflix depends on Microsucks Silverlight (which linux people hate), a sepperate Netflix browser must be installed. It used to be buggy, but it's come a long way. Another example of a compatability issue that has been fixed is using iPods with Linux. Yes, that is totally possible too. Again, it's just a matter of installing some extra software.

Anyway, if you want a dual boot system, you should install Windows first. If you already have Windows than you are in luck. If not, it is possible, but not really recommended to install Windows after installing a Linux system, because the ms-bootloader is a picky piece of sh**. So acquire a copy of your Windows distribution of choice (in most cases that would be Windows 7 Ultimate, because Windows 8 is a travesty), and go ahead and insert the disk into your machine. I'm not going to go into details about installing or acquiring Windows, so remember, Google is your best friend.

You should partition your hard disc during the Windows install to leave room for you Linux installation, unless you already have Windows, in which case the Linux installer can take care of that for you, but it will take a little longer because partitions must be shrunk, and that is time consuming. In this case, I am installing Win 7 Ultimate and Ubuntu 14.04 LTS on a 160 gig hard drive. The partition was be set up like this:

About 70 gigs was dedicated to Windows, and the rest was left unformatted for the Ubuntu installation. This was easily accomplished using the Windows installers partitioning tools. After booting to Windows, I then inserted the Linux Ubuntu disc, and restarted the computer. The computer was pre-set to boot to optical media if present. I manually partitioned the hard disc to give Linux about 8 gigs of disc space for swap, because this particular machine has 8 gigs of ram. a RAM/swap 1:1 ratio is a good rule of thumb. So I ended up with about 69 gigs for Linux, 8 for Swap, and the rest for Windows.

But upon rebooting the computer, it went straight to Windows. We need a bootloader to select which operating system to boot to. The natural choice is GRUB (the default Debian bootloader). For some reason it was not properly installed. So, I turned to boot repair disc! This is a very magical tool, and it flawlessly gave me the grub!

Next on the list is beefing up the security of the system. For some reason, spyware has made it even into some open source software these days. Every time I install Ubuntu on a computer, I remove the programs 'popularity-contest' and 'zeitgeist'. They do no good for anyone, and only serve to spy on you.

So, after installing Ubunut, open a terminal and do this:

sudo apt-get purge popularity-contest

And then,

ps -ef | grep zeit

Remove any packages it finds, be careful though. You can screw your system up if you accidentally purge something that is actually useful! (The two main ones are "zeitgeist" and "zeitgeist-core".) Enable the firewall:

sudo ufw enable

...and enjoy your new dual boot Win/Linux system! That's all for today.

Sunday, November 9, 2014

Locked Bootloaders Suck

Man I miss last summer. When you could root almost any Android phone with a one click exploit. Well, Motorola and many other companies have patched that up using modern encryption standards and requiring lock codes that can only be generated through their private keys. Potential dead end indeed... that kind of encryption takes a lot of computing power to break. Google is constantly rolling out OTA updates that give no new features and just patch the exploits.

Remember Google, don't be evil. Evil sucks. Well, to Google's credit, the Nexus line has allowed unlocked bootloaders all along.

With that said, where there is will, there is a way. In this case, just refuse to buy handsets that can't root. I am returning the Motorola E I just bought (sucky device anyways) and buying a GSM Google Nexus if I can find one in my price range. Because, Sunshine is right. Active roots were #solastsummer .

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.