Monthly Archives: May 2014

Edit hosts on a Mac OS X

Hosts files are located at /private/etc/.

Edit and add our new host configuration/ip.

sudo nano /private/etc/hosts

or

sudo nano /etc/hosts

Flush DNS cache

sudo dscacheutil -flushcache

This way we can have www.domain.com on a server for regular users and set up our own www.domain.com pointing to another server while we set up, for example, the migration.

rsync don’t overwrite existing files

Moving 500Gb from a server to another isn’t easy!
Especially with thousands of files to move….

I was using scp but connection most of the times was reseted and all that kinda of sh*ts.
rsync does the job. Its awesome. It syncs folders from server1 with server2 and with -z

rsync -avz /home/www/host1/tools.* [email protected]:/home/www/host1


-v, --verbose increase verbosity
-a, --archive archive mode; same as -rlptgoD (no -H)
-z, --compress compress file data during the transfer

Read more at http://linuxcommand.org/man_pages/rsync1.html

VPS Dreamhost / New Dream Network Speed test

 

Retrieving speedtest.net configuration…
Retrieving speedtest.net server list…
Testing from New Dream Network, LLC (64.111.112.229)…
Selecting best server based on ping…
Hosted by Fireline Broadband (Irvine, CA) [27.72 km]: 37.75 ms
Testing download speed………………………………….
Download: 310.53 Mbits/s
Testing upload speed…………………………………………..
Upload: 153.18 Mbits/s

 

Testing from New Dream Network, LLC (64.111.112.229)…
Selecting best server based on ping…
Hosted by California Internet Solutions (Los Angeles, CA) [37.84 km]: 40.77 ms
Testing download speed………………………………….
Download: 624.50 Mbits/s
Testing upload speed…………………………………………..
Upload: 75.94 Mbits/s

 

Testing from New Dream Network, LLC (64.111.112.229)…
Selecting best server based on ping…
Hosted by Fireline Broadband (Irvine, CA) [27.72 km]: 39.657 ms
Testing download speed………………………………….
Download: 382.79 Mbits/s
Testing upload speed…………………………………………..
Upload: 97.18 Mbits/s

 

Testing from New Dream Network, LLC (64.111.112.229)…
Selecting best server based on ping…
Hosted by Fireline Broadband (Irvine, CA) [27.72 km]: 35.048 ms
Testing download speed………………………………….
Download: 749.36 Mbits/s
Testing upload speed…………………………………………..
Upload: 79.82 Mbits/s

iptables – remove fail2ban entry

This is how!

root@sd-30000:~# iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num target prot opt source destination 
1 fail2ban-ssh tcp -- anywhere anywhere multiport dports ssh
2 DROP all -- 205.51.174.61.dial.wz.zj.dynamic.163data.com.cn anywhere

Chain FORWARD (policy ACCEPT)
num target prot opt source destination

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

Chain fail2ban-ssh (1 references)
num target prot opt source destination 
1 REJECT all -- bl7-128-82.dsl.telepac.pt anywhere reject-with icmp-port-unreachable
2 RETURN all -- anywhere anywhere 
root@sd-31453:~# iptables -D fail2ban-ssh 1

Peace!

Atom is now available for Mac users!

 

Atom is now available for Mac users and is open source, naturally. The company plans on releasing Linux and Windows versions very soon.

# Welcome to the Atom!

1. To help us improve the editor, Atom sends anonymous usage information. See
[atom/metrics](https://github.com/atom/metrics) for details on how to disable
the metrics package and what information is tracked.

2. If you only remember one thing make it `cmd-shift-P`. This keystroke toggles
the command palette, which lists every Atom command. Yes, you can try it now!
Press `cmd-shift-P`, type `markdown` and press enter. It will trigger the
`markdown-preview:show` command which renders this text to HTML.

4. Here is where you can get more help with Atom

* The [Atom docs](https://www.atom.io/docs) contain Guides and the API
reference.
* Discuss Atom at [discuss.atom.io](http://discuss.atom.io).
* The [Atom Org](https://github.com/atom). This is where all GitHub created Atom
packages can be found.

5. If you ever want to see this buffer again use the command palette
(`cmd-shift-P`) and search for `Welcome`.

 

“There is no other platform more flexible than the web, and so we built Atom using the same technologies. Extending Atom is as simple as writing JavaScript and CSS, two languages used by millions of developers each day, making it remarkably hackable,” the company wrote in an official blog post.

Read more at http://venturebeat.com/2014/05/06/githubs-young-text-editor-is-now-public-free-and-fully-open-source/

Laravel, confide translations / new names – confide::confide

So, imagine that we are using Laravel and creating a new form…

 <div class="form-group">
 <label for="nif">{{{ Lang::get('confide::confide.nif') }}}</label>
 <input class="form-control" placeholder="{{{ Lang::get('confide::confide.nif') }}}" type="text"
 name="nif" id="nif" value="{{{ Input::old('nif') }}}">
 </div>

We will see returned confide::confide.nif and not anything else…
How do we solve this?

Inside /app/lang/pt/ (pt is my default language… you should use yours…….) create the following file: confide.php and with a structure like the other files (duplicate,rename and change it) inside that folder create the new entries…

<?php
return array(
 /*
 |--------------------------------------------------------------------------
 | Confide Language Lines
 |--------------------------------------------------------------------------
 |
 | The following language lines contain the default error messages used by
 | the validator class. Some of these rules have multiple versions such
 | such as the size rules. Feel free to tweak each of these messages.
 |
 */
 "nome_completo" => "Nome completo",
 "morada" => "Morada",
 
 "nif" => "NIF",
 "email_confirmacao" => "Email Confirmação",

We now, have to CALL confide.nif and not confide::confide.nif.

Read more at
http://stackoverflow.com/questions/19338437/override-package-localization-in-laravel
https://github.com/laravel/framework/issues/2467#issuecomment-26211312
http://laravel.com/docs/localization#language-files

 

 

Sony announced it had crammed 185TB of data

Sony has brought the cassette back from the dead by unveiling a tape that can hold a whopping 148 gigabytes per square inch. If you can’t do the math, that’s 185 terabytes of total data.

(…)

So, just how much data can a tape with 185 TB capacity actually hold? Here’s a few handy comparisons (via ExtremeTech):

– It’s three Blu-rays’ worth of data per square inch. Or, a total of 3,700 Blu-rays on a single tape. That’s a stack of boxes that would be nearly 15 feet high.

– A single tape holds five more TB than this hard drive storage array, which has to be custom-made and runs for $9,305.

– A total of 64,750,000 songs. If the average song is, say, three minutes, that’s enough music to last you 134,896 days.

– The entirety of the Library of Congress represents about 10 total TB. One tape can hold 18.5 versions of the Library of Congress.

The tape will be available for commercial sale, but no word yet on a release date. However, as Gizmodo points out, the super tape was originally developed for “long-term, industrial-sized data backup” and not necessarily for music, game, and video storage and playback.

http://consequenceofsound.net/2014/05/r-i-p-ipod-sony-unveils-cassette-tape-that-can-hold-64750000-songs/