Archive for the 'Geeklife' Category

First Impressions Lenovo Yoga Pro and Windows 8.1 with a 2 in 1 device.

Saturday, February 1st, 2014

After now almost 2 weeks of heavy duty use of this machine, I must say Windows 8.1 is not fully baked when it comes to its tiled/touch/app store experience, however it’s not the nightmare I expected.

The FrostWire 5.7.0. currently circulating on the Internet was built on this machine, the experience was quite pleasant as a workstation, and then I carried it around for the North American Bittorrent conference and during that time it was a very convenient tablet while I was doing all the social networking during the event.

WordPress: Cannot create directory error, got everything chmoded to 777?

Monday, January 27th, 2014

So you went as far as chmod’ing your entire folder structure to 777 (very unsafe), you’ve hacked wp/wp-admin/includes/file.php

return new WP_Error( 'mkdir_failed_ziparchive', __( get_current_user() . ' Could not create directory. ('.$_dir.')' )...

to print out exactly what directory it cannot create and what user is trying to create the folder, everything is correct, yet it won’t create the fucking folder?

the issue might be your vsftpd configuration!

Go to /etc/vsftpd.con and make sure that you have this setting uncommented:

write_enable=YES

restart your vsftpd (sudo service vsftpd restart) and try upgrading again, you’ll want to hit that ‘Donate Bitcoin’ button if I saved your ass today.

Cheers

building cgminer from source on OSX

Sunday, January 19th, 2014

so you cloned the cgminer repo from github to build on your OSX machine and you get this bullshit error

$ ./autogen.sh
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname path
touch: /ltmain.sh: Permission denied
Use of chdir('') or chdir(undef) as chdir() is deprecated at /usr/local/bin/autoreconf line 670.
Configuring...
./autogen.sh: line 10: /configure: No such file or directory

readlink works differently in OSX and the current version of the autogen.sh script seems like it wasn’t tested on OSX (wonder why didn’t they use a simple bs_dir=`pwd`, the answer is probably canonical paths and what not).

To keep moving along, open the autogen.sh script and just change the value of the bs_dir variable to the full real path of where you have cloned the cgminer source code.

then execute your autogen script, make sure to enable compilation flags for your ASIC hardware, in my case I remember seeing ‘icarus’ on a binary build of cgminer I tried before, so I did

./autogen.sh --enable-icarus

you might want to enable all of them if you’re not sure what hardware you have or you will have in the future as you may not like the joys of building software (check out the the README for all the –enable-xxx options available)

If you’re getting errors on your configuration script due to missing dependencies, I strongly recommend you use Homebrew to install these packages (if you are using Macports or Fink, I strongly suggest you completely remove that crap from your computer and go 100% with brew, it works really well if you’re building a lot of code on a regular basis):

brew install autoconf automake autoreconf libtool openssl curses curl

brew, at the point of this writing didn’t have libcurl, so that one you will have to download, ./configure, make and sudo make install yourself from here http://curl.haxx.se/download.html (I used version 7.34 when I did it)

after that the autogen script should work, and then you should be just one ‘make’ away from your goal.

AWS troubleshooting: how to fix a broken EBS volume (bad superblock on xfs)

Sunday, January 19th, 2014

As great as EBS volumes are on Amazon Web Services, they can break and not ever mount again, even though your data could still be there intact, a simple corruption on the filesystem structure can cause a lot of damage. On this post I teach you how to move all that data onto a new EBS drive, so keep calm and read slowly.

So, you try to mount your drive after some updates and you get an error like this on dmesg | tail:

[56439860.329754] XFS (xvdf): Corruption detected. Unmount and run xfs_repair

so you unmount your drive, invoke xfs_repair and you get this…

$ sudo xfs_repair -n /dev/xvdf
Phase 1 - find and verify superblock...
bad primary superblock - bad magic number !!!

attempting to find secondary superblock...
..........................................

and no good secondary superblock is found.

Don’t panic, this is what you have to do next to solve this issue:

1. Go to your AWS dashboard, EC2 section.
2. Click on “Volumes”
3. Find the broken volume.
4. Create a snapshot of the broken volume (this takes a while)
5. Create a new volume the same size (or larger than) your old drive out of the snapshot you just created (this takes a while)
6. Attach your new volume to the same EC2 instance (no need to reboot or anything), if the old drive was mapped to /dev/xvdf, the new one will be mapped to /dev/xvdg (see how the last letter increases alphabetically)

Now here’s a gotcha, Amazon will not create your new drive using the same file system type (xfs), for some reason it will create it using the ext2 filesystem.

$ sudo file -s /dev/xvdg
/dev/xvdg: Linux rev 1.0 ext2 filesystem data (mounted or unclean), UUID=2e35874f-1d21-4d2d-b42b-ae27966e0aab (large files)

Here you have two options:
1. Live with the new ext2 file system, make sure your /etc/fstab is updated to look something like this:
/dev/xvdg /path/to/mount/to auto defaults,nobootwait,noatime 0 0

or 2. copy the contents of your drive to a temporary location, usually inside /mnt which has plenty of space from that ephemeral drive the ec2 instances come to, and then mkfs.xfs the new volume, and then copy the contents back… (which what I did, as I chose to create a larger drive and the ext2 format that came on the new volume only recognized the size of the snapshot)

Hope this saved your ass, leave a note if I did.

Remember to never do any irreversible action until you have a disk snapshot, try your best to never lose data.

How much electricity does the Facebook app consume everyday by making phones vibrate with push notifications?

Monday, August 26th, 2013

My silly little goal is to convince Facebook to pre-configure its mobile apps so they don’t make phones vibrate by default and push silent notifications to mobile users.

Help me make an estimate, we need to know on average how many milliwatts the average phone will spend per notification, and an estimate of how many push notifications are received by smartphones worldwide from facebook.

Say a phone consumes 150 milliwatts per push notification, and in one minute alone facebook sends 1 million notifications, Facebook would be consuming the world about 9 Megawatts/hour. This would be just a number thrown out there since I don’t know for sure if that’s the average power consumed, nor I know how many notifications are received per minute, I bet it’s way more than 1 million per minute.

Would love the help from people who work at Facebook or who have stats on push notifications, as well as any engineer working with phone hardware at any major phone manufacturing company.

Twitter is also sending a lot of notifications to phones.

Turn off vibration on your Facebook app, you will save a considerable amount of battery every day.

can’t ssh to ec2 ubuntu instance, /etc/fstab breaks bootup due to missing ebs volume [SOLVED]

Wednesday, August 21st, 2013

Screen Shot 2013-08-21 at 12.08.04 PM

So the /etc/fstab file on your root volume looked like this

LABEL=cloudimg-rootfs / ext4 defaults 0 0
/dev/xvdf /mnt/backups auto defaults,comment=cloudconfig 0 2

by mistake you deleted the ebs volume that you had mounted on /mnt/backups (or whatever folder) and you restarted your ubuntu instance not knowing that if the /etc/fstab would break it would not continue to start all the application layer networking services like ssh on port 22…

you can ping the machine, but you can’t ssh, amazon support won’t respond or will tell you to fuck yourself.

you learn that ubuntu has had this bug for a while, but it’s been addressed by passing your volume configuration a nobootwait option.

you wish your /etc/fstab looked like this, but you can’t get in, amazon doesn’t give you any other options from their console to go in and solve the problem through a console…

LABEL=cloudimg-rootfs / ext4 defaults 0 0
/dev/xvdf /mnt/backups auto defaults,nobootwait,comment=cloudconfig 0 2

No worries, I have a fix that will let you edit that file, and boot back and try to recover things, you may have lost that ebs volume, but you won’t have to setup this computer again.

1. Make a snapshot of the root volume on that instance. This will take a while.
2. Make a new ebs volume of that snapshot and put it on the zone where the ec2 instance lives.
3. Create an identical temporary new ec2 instance on the same zone.
4. Attach the snapshot volume you created on step 2 to the new instance.
5. ssh to the new machine.
6. sudo fdisk -l, you should see all the attached devices, you will see something like this referring to the attached ebs

Disk /dev/xvdf: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/xvdf doesn't contain a valid partition table

Don’t listen to that last message, you do have a valid partition.

7. Create a folder where to mount the disk. sudo mkdir /mnt/old-volume
8. Mount it sudo mount -t auto /dev/xvdf /mnt/old-volume
9. Get into /mnt/old-volume/etc/fstab and fix it.
10. Unmount /mnt/old-volume, turn off the instance, detach the repaired volume.
11. Turn off the original instance, detach the broken root volume (at /dev/sda1)
12. Attach the repaired volume to the original instance under /dev/sda1
13. Start the original instance.
14. ssh to it. (it will have a new ip address, make sure to update your DNS or load balancing entries)
15. Terminate the temporary instance and all the volumes that you won’t need.
16. Get to work.
17. Leave a tip below. ;)

Obama Warholized by #CODE (Williamsburg, Brooklyn)

Wednesday, August 7th, 2013

obama-warholized-by-code-in-random-williamsburg-building

19 Reasons to switch to eBooks/eReaders

Wednesday, July 10th, 2013

So I’m tired of evangelizing eBooks/eReaders in person and I guess I’ll do a lot more good by writing this so that you can share it next time you want to convince a friend to live in the year 2013 and stop the mad romanticism about the handicapped physical books, it’s just ludacris reading a book on paper unless it has no digital form.

Here is an ever growing list of why I prefer eBooks to physical books
(got more reasons, leave a comment below)

1. They are cheaper.

2. They are available immediately, no need to order, wait, or move physically to get them.

3. They never get lost.

4. They don’t take any space, or weight, this brings many added benefits to the world:

4.1. You can have a library of thousands of books with you wherever you are, on different devices (since they can be stored in the cloud)

4.2. You will free a lot of shelve space at home/office, which also means less dust being created at home.

4.3. If all students were forced to use eBooks they wouldn’t have to carry such heavy backpacks which can deform their spines.

4.4. If all students used eBooks exclusively, there would be CO2 emission reductions since that’s a lot of weight that doesn’t have to be transported by cars/buses/trains.

5. You can read them on different devices: e-readers, computers, smartphones.

6. You can copy and paste.

7. If you lend them you never have to beg your friend to give the book back, it comes back to you automatically.

8. You can search inside them.

9. If you don’t know the meaning of a word, a dictionary is always there for you, just touch/click the word in question.

10. The same book may come in different languages.

11. You can change font types, font sizes, color of the screen, margins, line spacing.

12. You can have lots of bookmarks, you can navigate your bookmarks.

13. You can read them with the light turned off.

14. You can read them with one hand, turning pages is effortlessly. Awesome when you go out for a walk and you have only one hand available.

15. No more wrinkled, stained, or broken pages.

16. You can share your highlights on social networks.

17. You can open a web browser right from the book if there’s a web reference.

18. There’s no such thing as “out of print”

19. It learns your reading speed and tells you how much time left you have on the current chapter or the whole book.

need more reasons?
or you will keep reading books because you like the smell of paper, even though there’s really a lot of stinky books out there.

are you still using cassette tapes, vinyl discs, hell are you still using CDs?

Make the switch, you will enjoy reading like never before.

Google Glass to enrich Google Maps/Earth with fine grained 3D Models of reality

Monday, June 24th, 2013

I was imagining a world maybe 5 years from now, where there’s an insane amount of Google-Glass-like devices out there.

If Google was bold enough to map the streets with cars equipped with GPS and cameras, I think one of the top uses they must have somewhere on their master plan is to use every Glass user’s video feed to map reality to a more fine grained level. It’s easy to see how this data could be used to create 3D detailed models of every city in the world, not just out on the street, but inside buildings to provide us with navigation everywhere, outside or inside.

This will def. be another level of creepy, I foresee a battle to preserve the privacy inside homes and office once this starts happening. How do you prevent someone else from not mapping the inside of your home or house and uploading it to the web?

VIDEO: Coding the FrostWire search filters UI

Monday, June 24th, 2013

Get in the zone with me for a good 15 minutes, maybe you’ll catch a few eclipse tricks and you’ll learn a little bit about how I think (and make mistakes along the way of fixing something on FrostWire)




  • Categories

  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • October 2009
  • September 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004