How to Replace Galaxy Note 4 Screen – by Zedomax!

Over the past year or so I’ve become a fan of @Zedomax on Twitter. He caught my attention with his open frame bitcoin miner design. About a year and a half ago I got into mining Litecoin, Dogecoin, and using exchanges to play a bit of the Bitcoin game. I soon discovered how resourceful Zedomax’s channels and websites are, and wondered why I never seen these show up on Google SERPS. Let’s not get into SEO!

Max recommends getting the LCD screen with assembly, which makes replacing the LCD screen less complex and is only about $20 more. All you have to do is swap over the motherboard, camera, and back frame.

This video is a bit inspiring, it’s been a while since I’ve rooted, flashed, and help fix broken Android phones. Perhaps I’ll have to provide my services to local friends when I have downtime. :]

AT&T Galaxy S4 Prevent/Freeze OTA Updates

5588953445_51dcf922aa_o

Prevents NI4 to NJ4, the AT&T/Samsung OTA update keeps bugging me and I want to turn off the software update. If you are on a rooted AT&T Galaxy S4 and want to prevent the OTA update you can block the following apps with App Quarantine ROOT/FREEZE. Last time my OTA updated it went to NI4, broke Safestrap and Towelroot!

Block these in App Quarantine, tap the Settings icon and tap Filter, turn on Advanced and check Include system services. Block the following apps according to guut13 on XDA Forums.

  • AT&T Software update
  • wssyncmlnps
  • LocalFOTA

citation:
https://play.google.com/store/apps/details?id=com.ramdroid.appquarantine&hl=en
http://forum.xda-developers.com/showpost.php?p=56765224&postcount=36
http://netdungeon.com/stopping-att-android-software-updates/
photo curtious of etnyk on Flickr under Creative Commons!

TP-LINK TL-WN725N on BAMT 1.5

LitecoinMiner-5

I recently was asked to take a look at a Litecoin miner logs due to stability issues, I had no idea how deep this rabbit hole would go. After many struggles with Xubuntu and AMD drivers, I found BAMT. BAMT aka “Big Ass Miner Thing” is a fork of the original BAMT project that was aborted, picked up by Bee on litecointalk.org – I’ve since rebuilt a miner and built 2 personal litecoin mining rigs. If you are in Bellingham, Whatcom, Skagit, Snohomish, or Vancouver Lower Mainland and need technical assistance with Bitcoin / Litecoin miners, feel free to reach out. I do it for the Dogecoin!

Repository can be found here:
https://bitbucket.org/beebee/bamt/

Download BAMT from Bee’s maintained thread:
https://litecointalk.org/index.php?topic=2924.0

How To Get TP-LINK TL-WN725N on BAMT 1.5

I wanted to use a USB Wifi dongle on BAMT for my dogecoin mining rigs so that I can relocate them into my garage. I randomly ordered a cheap $9 Wifi USB dongle on Amazon and figured making the leap of faith would be fun. Here’s how I got it running on BAMT.

I referenced WikiDevi.com for the appropriate repository to clone. I had the v2 of this Nano USB.

https://wikidevi.com/wiki/TP-LINK_TL-WN725N_v2

The repository is in the sidebar, I laughed audibly when I figured out BAMT has git natively, thank you Bee or whoever put that there! If you’re version of BAMT doesn’t have git, in Root Terminal type: apt-get install git

If you’ve never compiled from source before, open up Root Terminal:

cd ~/
git clone https://github.com/lwfinger/rtl8188eu.git
cd rtl8188eu
make
sudo make install

These steps may vary, make sure you’re using the correct repository. If you’re not using a TP-LINK Google around or look around WikiDevi.com for your hardware.

I got frustrated when passphrase didn’t save. Posted to /r/bamt – after a bit I made an edit:

http://www.reddit.com/r/BAMT/comments/1zlvjm/wireless_usb_doesnt_save_network_passphrase/

johnislarry wrote:
So I managed to find a solution to my problem. I don't know if it will help anybody else, but maybe it will. I changed two things. The first was creating a file
/etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla
and writing the following lines to it:

[nm-applet]
Identity=unix-group:network
Action=org.freedesktop.NetworkManager.*
ResultAny=yes
ResultInactive=no
ResultActive=yes

That can also be found here https://wiki.archlinux.org/index.php/Ne … ermissions and it allows users in the group "network" to use nm-applet functionalities. The second > thing I changed was commenting out a "no-auto-default" line in /etc/NetworkManager/NetworkManager.conf.
After these changes I am able to use nm-applet as a regular user for connecting to both secured and unsecured networks.

Also note: when saving the wifi passphrase check “Available for all users” before clicking Apply!

Got my TL-WN725N to work on Bee’s BAMT 1.5 and now I can relocate the box into the garage without running a 50 ft cat6 across the house. 🙂 hope this helps.

Varnish HTTP Accelerator Presentation Notes

varnish-cache-image

Poul-Henning Kamp discusses Varnish HTTP Cache at TYPO3 2010 in Frankfurt. In this post, I will provide detailed notes of his presentation. This is for learning purposes and may contain inconsistencies. I will do my best to keep it sharp.

Varnish HTTP Accelerator Presentation Slides

Notes From Varnish HTTP Cache @ TYPO3 w. Poul-Henning Kamp

Content creation can be automated, you have a master copy and you want to distributed it as much as possible. You really want it to be faster than the Linotype, and a step beyond the Heidelberg Print Machine. Varnish’s Elevator Pitch, “Varnish delivers content faster & reliably, reduces the load on your CMS database, cheap hardware does 100+ kreq/s, can assist in content composition, can fixx stupid mistakes, fast, is Free & Open Source Software, has commercial support.”

After 15 years contributing to the FreeBSD project, Poul-Henning Kamp was approached by VG.no to write a web server. VG.no utilizes a slow CMS which needed a caching system that speeds up the HTTP accelerators. With Varnish, Kamp was able to reduce the use of 12 Squid cache services to a mere 3 Varnish cache servers and greatly reducing the response times.

Poul-Henning Kamp’s goals for Varnish started out simple

  • Varnish is only a HTTP Accelerator.
  • Better configuration.
  • Much Faster
  • Content Management Focused Feature Set

“We don’t do FTP, we do HTTP and we do it damn well,” Kamps continues “This is not a cache to put on the client side, this is a cache to put on the server side. It’s important to understand one thing here, the controlling standard for HTTP is still RFC2616, and if you read it real carefully you will find one place where it mentions a cache on the server side,” “then they realize, actually a cache on the serverside is just another web server.”

Cache on the client size has constraints, you cannot cache per user, private cache, crypto, etc. Varnish as a web server can cache anything we want server side, including crypto!

Understanding Varnish and VCL

Varnish aims to make the configuration process simple in VCL or C language. It’s important to understand the operations of Varnish according to the diagram below.

varnish-state-machine

An example of receive VCL code below.

sub vcl_recv {
if(req.url ~ “\.\.|\.exe”) {
error(999, “Bugger off.”);
}
if(client.ip ~ editor_ip) {
set req.http.x-cms = “no stats”;
return(pass);
}
if(req.url ~ “\.(jpg|png|gif|css)$”) {
unset req.http.cookie;
unset req.http.authenticate;
set req.backend = static_backend;
}
if(req.url == “hotstory.hmtl”) {
set.url = “hotstory.html”);
}
}

Understanding Why Varnish Cache Language Is Epic

  • Compiled to binary/shlib via C-code
    • Runs full speed
  • You can have multiple VCL’s loaded at the same time
    • Switch between them without restart
    • Instantaneous
  • Allows you to do anything you might fancy
    • Inline-C code, ’nuff said.
    • Modules/shlib will make it easier (3.0 feature)

Wikia has broken the 4000+ lines of VCL code and is available online via SVN for all to study.

An example of how Wikia’s VCL code utilizing multiple varnish servers. In this example there are two Varnish servers, one in Germany and one in England. The client is located in Germany attempted to access a server in the US. The client hits the Germany varnish server first, but the German Varnish server tells the client to connect to England Varnish than to the US because England’s pipe to the United States is bigger. This speeds up the load times since Germany’s direct tube to the US is clogged. You can’t just dump stuff on it, it’s a truck.

sub vcl_recv {
if (client.ip == “varnish1”) {
set req.backend = usa;
} else {
set req.backend = england;
}
}

Managing Varnish

Varnish is a daemon process on your computer and utilizing Command Line Interface for real-time control. The Management/Working process split. The manager allows (re)start the worker proc. Allows privilege separation. It also contains multithreading to worker process.

varnish_architecture_shah_anand

Image Source: shah-anand.com (thx bro).

Looking over the Varnish architecture we have one binary program that contains two processes, the Managing Process and Cacher process. The managing process will take your VCL code, send it to the C-compiler, and off to shared object for the Cacher process loads. Varnish Cache also has a cluster control concept that can control 10 different instances of Varnish is separate geolocations. The cluster control is still a concept and is not built out.

One thing to note: Varnish does not write .lock files – it has a shared memory segment, it places lock information and statistics in there and other applications will pull from the shared memory.

Brief CLI Management

Example of CLI Management below (I am a bit lost on this because on param.show I get an error on my instance.

$ telnet localhost 80
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’
param.show
200 675
default_ttl 120 [seconds]
thread_pools 5 [pools]
thread_pool_max 1500 [threads]
thread_pool_min 1 [threads]
thread_pool_timeout 120 [seconds]
overflow_max 100 [%]
http_workspace 8192 [bytes]
sess_timeout 5 [seconds]
pipe_timeout 60 [seconds]
send_timeout 600 [seconds]
auto_restart on [bool]
[…]

Performance & Speed

Programmed for performance since day one. They wanted to make sure they were aiming for wire speed. Performance is not something you do after the fact, you do it from day one and don’t add things that will bog it down. Writing the code for Varnish aims for today’s complex hardware. This isn’t designed for your dad’s computer anymore!

Use modern features:

  • Virtual Memory
  • sendfile(2), accept_filters(2), kqueue(2)
  • and ever other trick in the book

Performance price list has changed, we can execute 100,000,000+/s per cpu. Disk I/O is behind on response time, stored memory is instead placed in virtual page memory (RAM). Classical logging is horribly expensive. (Examples in slides).

Where does my traffic come from?

Below are a few commands that you can use to access information on a live Varnish instance.

$ varnishtop -i Rxheader
$ varnishtop -i Rxurl
$ varnishhist

Varnishhist is real-time histogram that shows the cache-miss (#) / cache-hit (|) on an x & y axis.
$ varnishstat

Varnishstat pulls real-time statistics from shared memory

Content Management Features

  • Instant action purges/bans (regex or exact match)
  • TTL/Caching policy control in VCL
  • Load/Situation mitigation in VCL
  • Header washing
  • Vary
  • Edge-side-includes (ESI)

27:14

BitTorrent SyncApp Alpha Testing

syncapp

Today, I received my invitation to alpha test BitTorrent SyncApp. I can only imagine the implications this will open up. Although Dropbox is safe, secure, and redundant, how safe is your files? SyncApp is interest, I generate a secret key and designate my “SyncApp” folder. I fire it up my laptop and install SyncApp.exe and punch in my secret key. Immediately, over 2,800+ files in my WordPress localhost is synced to my laptop. This afternoon, it’s synced to a 3rd box. I am interested in taking this to the next step and placing my files on a Linux server in California… with all my private git repositories. I wonder how well git will behave with SyncApp?

I think the most fascinating implication of SyncApp that I can brew in my mind is utilizing it over a Meshnet. Think of tying several Meshnet nodes in Bellingham and giving end users the “secret key” – madness. I wonder if there’s anyone in Bellingham that has already thrown up Meshnet nodes?

The next plan of actions with alpha testing BitTorrent SyncApp will be to tie all of my company files (.psd, .ai, .eps) between 3 computers and potentially a 4th. Perhaps my personal dedicated server down in California? Or maybe I should throw up an experimental Amazon EC2 with block storage? D: OMFG, way to excited.

Bash Script TimThumb Update [cPanel/WHM]

If your dealing with a large WordPress instance, I hope you have shell. Using plugins like Timthumb Vulnerability Scanner on small installations is great, however, on large installations the server might 503.

I had previously used bash scripts to detect outdated TimThumb using simple grep command and outputting the finding to a .txt file which I could cross reference during the update process. It’s become cumbersome to do this, I wanted to grab the updated timthumb version from the Google Code repository and update the files. With a quick Google search, I fould this simple script for cPanel users that can be modified to your distro. Props to DropDeadDick.com for sharing his script. <3 [bash] #! /bin/bash # Detects and updates timthumb.php to latest version for all cPanel users. # dropdeaddick.com latest=`lynx -source http://timthumb.googlecode.com/svn/trunk/timthumb.php |grep "define ('VERSION'" $file |cut -f4 -d"'"` if [ -z "$latest" ]; then echo "could not get latest timthumb release, aborting!" exit 1 fi for user in `awk -F':' '{ if ($3 > 499) print $0 }' /etc/passwd | grep home | cut -d':' -f1`; do for file in `find /home*/$user/public_html/ -type f ( -name 'thumb.php' -o -name 'timthumb.php' ) 2>/dev/null | tr ' ' '%'`; do file=`echo $file | tr '%' ' '` check=`grep -c "code.google.com/p/timthumb" "$file"` if [ -z "$check" ]; then break fi if [ "$check" -gt "0" ]; then version=`grep "define ('VERSION'" "$file" |cut -f4 -d"'"` if [ "$version" != "$latest" ]; then echo -e "e[1;31mWARNING version $versione[0m updating $file!" # rm -f $file #delete current file before replacing. wget -nv -t3 -T3 http://timthumb.googlecode.com/svn/trunk/timthumb.php -O "$file" chown $user: "$file" else echo -e "e[1;32mOK version $versione[0m skipping $file" fi fi done done[/bash] I'd recommend creating an alias so that you can use it periodically. :]

How To REMOVE Crap In footer.php w. grep sed

penguin-beer

Lets get ride of garbage hard coded in premium themes. Only doing this because 1.) GPL and 2.) I paid for this theme, why is their copyright in it? 🙁 Do I have to buy you a beer too? More than willing too. :]

[bash]grep -lr –include=footer.php "<p id="copyright">" /home/USERNAME/public_html/wp-content/themes | xargs sed -i ‘s#<p id="copyright"><?php printf( __([^;]*; ?></p>##g'[/bash]

If this looks Greek to you, I’d recommend reading up on grep and sed documentation. There are great examples of how to use it with regex.

Unified Remote – Androids Answer To Wireless PC Remote!

One of the main reasons I need a wireless PC remote is Netflix and Hulu Plus… I do not own a Television, and if I have a “movie date night” it’s kind of odd to have my guest sit as I awkwardly fumble a keyboard and wireless mouse in the dark.

A few nights ago while I was laying their with my girlfriend, we were coming up to the end of an episode of Sekirai. I couldn’t find my wireless mouse and decided to Google around for a solution.

I ended up finding a god sent savior, Philip from Unified Remote to the rescue!

I quickly downloaded the app and installed the server side client to my PC all while Sekirai continued to play on Netflix. Without a hesitation, Kayla asked, “What are you doing babe?”

Why Is Unified Remote The Best?

I have tried many different types of remotes. Let’s break it down: Xbox 360 Wireless Controller + Wireless PC Dongle, Windows Media Center PC Remote Control, Logitech Wireless G700, TeamViewer for Android, and I’m NOT about to pay $40 for Logmein for Android! To put it simple: Unified Remote has a built in mouse touch pad, utilizes the Android keyboard for input, has specialized remotes for Netflix, Hulu Plus, Pandora, Windows Media Player, VLC, foobar2000, iTunes, and much much more.

TL:DR; Unified Remote has a mouse pad, keyboard, Netflix, Hulu Plus, VLC, iTunes remote.

Inspiration: WordPress Multisite Running On Amazon Web Services

I honestly don’t know why, but I have always feared the day that I would dive head first into Amazon Web Services. In the last two weeks, I have been researching the in’s and out’s of AWS, how people are using it to deploy applications, security, it’s architecture and reading AWS terminology… It is very overwhelming, but I think it’s time I embarked on this adventure.

A few inspirations, Earmilk.com’s Blake Shoji. Although I have never met IRL, nor interacted with him online; the Earmilk network boggles my mind. They definitely sparked my curiosity! If your a music lover, I’d recommend checking them out!

While I was reading up on AWS, I happen to find David Jensen’s blog post on how to install WordPress on Amazon AWS EC2. I am going to use this documentation as a basis for my study, although I do want to branch off to NGINX. We’ll see where the path takes me!

If you need further inspiration that will help motivate you to jump into the cloud, I highly recommend watching “The Known Universe” with The XX Intro Extended dubbed over it. Seriously, the possibilities are endless!

How To Fix AT&T Galaxy S2 Wifi Issue After Root 2.3.6

If you’re a fan of The Unlockr and happen to pick up the AT&T Galaxy S2 (SGH-i777)… You may have flipped upside down and started dragging your head on the keyboard in frustration after you realized your wifi is completely broken! I have the solution.

Fluff: After digging around the XDA and Android Device Forums I found that factory AT&T Galaxy S2 typically came with 2.3.4, most write-ups online is for 2.3.4. Samsung’s recent OTW release 2.3.6, left thousands of Superusers with wifi connectivity issues due to having the wrong kernel.

How To Fix AT&T Galaxy S2 Wifi Issue Under 2.3.6

1.) Calm the fuck down, sip your coffee, breath.
2.) Goto: http://forum.xda-developers.com/showthread.php?t=1289460
3.) Download the latest Attached File (as of 2/12/2012 it is DD_02072012.zip note the retarded naming convention is a time stamp for DD_[02/07/2012].zip – I thought the top attached file was the latest)
4.) Connect Galaxy S2 to your PC/Mac, enter USB Storage Mode, place the .zip file onto your device (just put it in the root).
5.) Power off device and enter ClockworkMod Recovery Mode (By holding down the volume down, volume up button, and the power button. Let go of the power button once the device turns on and continue to hold the volume buttons until the recovery screen loads.)
6.) Use vol up / down to highlight “install zip from sd” then use the home button to select (maybe different on other devices)
7.) Select the .zip file, install, reboot device.

When the OS loads you should be able to go to Settings -> Wifi and see all your hotspots. Connect and test.

image

Note: Please let me know if this does not work for you in the comments. I can further assist / update for others. Thanks!

UPDATE AS OF 6/26/2012: As of June 26, 2012 Samsung has released the OEM Ice Cream Sandwich. Previously, I decided to try out the leaked version that surfaced on the XDA forums. I am currently working on trying out the Samsung official release of ICS. I advise precaution, PROCEED AT YOUR OWN RISK.

UPDATE AS OF 12/1/2013: My AT&T Samsung Galaxy S2 has died as of 11/29/2013… The power button seems to have failed, causing to randomly turn on and off or stick (making it so I cannot wake / lock the screen.) I am very distraught! 🙁 If you by chance found this post, I hope this works for your phone. If you run into issues I can do my best to help. But if you run into an issue and figure out a way around it feel free to leave feedback for future reference. Ironically, I was able to pick up a free Samsung Galaxy S4 on Black Friday. Time to void the warranty! RIP S2, if I find another one on CL cheap I’ll turn it into a dedicated car mp3 player. 🙂