martes, 14 de mayo de 2013

CodeIgniter global variable

It's not necessary to use global variable in codeigniter, you can do this:

class MY_Controller extends Controller {
  var $data;    
  //constructor function            
}

class Contact extends Controller { //to.. }

class Contact extends MY_Controller {
 $this->load->view('contact_view', $this->data);
}

lunes, 6 de mayo de 2013

Apache Restart / Stop


Restart Apache 2 web server, enter:

# /etc/init.d/apache2 restart

If you are using Ubuntu use sudo:

$ sudo /etc/init.d/apache2 restart

To stop Apache 2 web server, enter:

# /etc/init.d/apache2 stop

$ sudo /etc/init.d/apache2 stop

To start Apache 2 web server, enter:

# /etc/init.d/apache2 start

$ sudo /etc/init.d/apache2 start

domingo, 5 de mayo de 2013

Downloading file from my server to my local


To download the file "serials.txt" from your remote home dir to the local computer:

scp user@server.com:serials.txt .

To download the remote file "something" using it's full path to your local computer:

scp user@server.com:/path/to/file/something.txt .

Now the tricky part: using the recursive switch (-r) to download a whole folder to your local computer. The issue you may have is that you DO NOT place a trailing forward slash after the directory name. For instance, this command will NOT work (notice the bold forward slash):

scp -r user@server.com:/path/to/directory/ .

This will give you a message saying the server is trying to write to the parent directory. REMOVE the last foward slash on the path and try again. The next command is CORRECT:

scp -r user@server.com:/path/to/directory .

I have been using a period when talking about downloading so far. Reason: this brings the file into the directory you are currently in. If you wish to take the last command and download it to somewhere else, the command would be:

scp -r user@server.com:/path/to/directory /new/local/location/

jueves, 25 de abril de 2013

How to remove all .svn directories from my application directories

find . -name .svn -exec rm -rf {} \;

Before running a command like that, I often like to run this first:

find . -name .svn -exec ls {} \;

Apuntes subversion

# Entramos con root al servidor e instalamos el paquete de subversion
apt-get install subversion

# Creamos una carpeta para guardar los repositorios
mkdir -p /srv/subversion

# Accedemos a la carpeta y creamos un repositorio llamado 'pruebas'
cd /srv/subversion/
svnadmin create pruebas

# Editamos la configuracion del nuevo repositorio
vi /srv/subversion/pruebas/conf/svnserve.conf

# Modificamos las lineas
# anon-access = read
# auth-access = write

por:

anon-access = none
auth-access = write

y descomentamos la de:

# password-db = passwd

# Creamos los usuarios que tendran acceso al repositorio
vi /srv/subversion/pruebas/conf/passwd

# Iniciamos el servicio
svnserve -d -r /srv/subversion/ &

# Ahora tenemos corriendo un servicio que sirve la carpeta /srv/subversion
# y todos los repositorios que existan en ella
# la url para acceder será: svn://IP_DE_LA_MAQUINA/NOMBRE_REPOSITORIO
#
# en mi caso: svn://servidor/pruebas

# Bajamos el codigo en el portatil y ya podemos trabajar
svn co svn://servidor/pruebas /var/www/pruebas/

# Cre una carpeta y un fichero y los envio
cd /var/www/pruebas/
mkdir trunk
svn add trunk
svn commit -m 'Creando el trunk'

# Y a trabajar!!!!

martes, 23 de abril de 2013

Como saber que programas tengo instalados en mi ubuntu


Fácil, vez a consola y ejecuta:

dpkg --get-selections | grep -v deinstall

Si la lista es larga y quieres puedes generar un archivo por ejecplo en tu ruta por defecto, tu home:

dpkg --get-selections | grep -v deinstall > paquetes-instalados-en-ubuntu



...espera! quieres la lista más completa y con fechas???

prueba esto:

cat /var/log/dpkg.log | grep "status installed"

Diferencia entre apt-get update y apt-get upgrade


Seguramente, muchas veces hemos usado:
# apt-get update
# apt-get upgrade
Pero, ¿qué hace cada orden o comando?

Cuando nosotros utilizamos #apt-get update, lo que en realidad estamos haciendo es actualizar los repositorios --ver si hay algo nuevo--, es decir actualizar la lista de todos los paquetes, con la dirección de dónde obtenerlos para que a la hora de hacer la búsqueda y su posterior descarga, sea más rápida.

En cambio, cuando utilizamos #apt-get upgrade, lo que hacemos es una actualización de nuestro sistema con todas las posibles actualizaciones que pudiera haber, es decir no sólo actualiza nuestro sistema operativo sino que también las aplicaciones que están contenidas en los repositorios.

En resumen: el update lista los paquetes de los repositorios y el upgrade instala las actualizaciones.

viernes, 30 de marzo de 2012

Who owns facebook?

Mark Zuckerberg
Status: Founder, CEO
Age: 27
Residence: Palo Alto, CA
Education: Two years at Harvard University

Accel Partners
Status: Venture Capital Investor
Founded: 1983
Location: Palo Alto, CA

Dustin Moskovitz
Status: Former Employee
Age: 27
Residence: San Francisco, CA
Education: Two years at Harvard University


Digital Sky Technologies
Status: Corporate Investor
Founded: 2005
Location: Moscow, London

Eduardo Saverin
Status: Former Employee
Age: 29
Residence: Miami, FL
Education: BA/BS, Harvard University

Sean Parker
Status: Former Employee
Age: 32
Residence: San Francisco, CA
Education: High School Graduate,
Oakton High School,VA

Peter Thiel
Status: Angel Investor,
Member of Board of Directors
Age: 44
Residence: San Francisco, CA
Education: JD, Stanford University

Sheryl Sandberg
Status: Current Employee
Age: 42
Residence: Silicon Valley
Education: BA, Harvard College; MBA, Harvard Business School

Microsoft
Status: Corporate Investor
Founded: 1975
Location: Seattle, WA

Greylock Partners
Status: Venture Capital Investor
Founded: 1965
Location: Menlo Park, CA; Cambridge, MA

Meritech Partners
Status: Venture Capital Investor
Founded: 1999
Location: Palo Alto, CA

Elevation Partners
Status: Venture Capital Investor
Founded: 2004
Location: Menlo Park, CA

Jim Breyer
Status: Angel Investor
Age: 50
Residence: Woodside, CA
Education: BS, Stanford University;
MBA, Harvard University

Goldman Sachs
Status: Corporate Investor
Founded: 1869
Location: New York, NY

Chris Hughes
Status: Former Employee
Age: 28
Residence: New York, NY
Education: BA, Harvard University

Li Ka-Shing
Status: Angel Investor
Age: 83
Residence: Hong Kong

Matt Cohler
Status: Former Employee
Age: 34
Residence: San Francisco, CA
Education: BA, Yale University

Jeff Rothschild
Status: Current Employee
Age: 56
Residence: San Francisco, CA
Education: BS in Psychology, MA in Computer Science, Vanderbilt University

Adam D'Angelo
Status: Former Employee
Age: 27
Residence: Palo Alto, CA
Education: BA, California Institute of Technology

Owen Van Natta
Status: Former Employee
Age: 42
Residence: San Francisco, CA
Education: BA, University of California,
Santa Cruz

T. Rowe Price
Status: Corporate Investor
Founded: 1937
Location: Baltimore

WTI
Status: Venture Capital Investor
Founded: 1980
Location: San Jose, CA

Reid Hoffman
Status: Angel Investor
Age: 44
Residence: San Francisco, CA
Education: BS, Stanford University; MA Oxford University

Mark Pincus
Status: Angel Investor
Age: 45
Residence: San Francisco, CA
Education: BS, University of Pennsylvania; MBA, Harvard Business School

Interpublic
Status: Corporate Investor
Founded: 1870 (predecessor company)
Location: New York, NY

Marc Andreessen
Status: VC Investor and Board Director
Age: 41
Residence: Silicon Valley
Education: BA, University of Illinois at Urbana-Champaign

Justin Rosenstein
Status: Former Employee
Age: N/A
Residence: Silicon Valley
Education: Stanford (did not graduate)

David Choe
Status: Former Employee
Age: 35
Residence: Los Angeles, CA
Education: California College of the Arts

Andreessen Horowitz
Status: Venture Capital Investor
Founded: 2009
Location: Menlo Park, CA

Fidelity Investments
Status: Corporate Investor
Founded: 1946
Location: Boston

David Ebersman
Status: Current Employee
Age: 41
Residence: Silicon Valley
Education: BA, Brown University

Mike Schroepfer
Status: Current Employee
Age: 46
Residence: San Francisco Bay area
Education: BA and MA, Stanford University

Theodore Ullyot
Status: Current Employee
Age: 43
Residence: San Francisco Bay area
Education: BA, Harvard; JD, University of Chicago

Samwer Brothers: Marc, Oliver, and Alexander
Status: Angel Investors
Age: Marc, 40; Oliver, 37; Alexander, 32
Residence: Berlin, Germany; Silicon Valley
Education: Marc, JD, Univ. of Cologne. Oliver, Bus. Degree from WHU. Alexander, MA, Oxford; MBA, Harvard University

General Atlantic
Status: Venture Capital Investor
Founded: 1980
Location: New York, NY

Ezra Callahan
Status: Former Employee
Age: 31
Residence: Los Angeles, CA
Education: BS, Stanford University

Kleiner Perkins
Caufield & Byers
Status: Venture Capital Investor
Founded: 1972
Location: Menlo Park, CA

Cameron Winklevoss
Status: Enemy
Age: 30
Residence: Unknown
Education: BA, Harvard University; MBA, University of Oxford

Tyler Winklevoss
Status: Enemy
Age: 30
Residence: Unknown
Education: AB, Harvard University; MBA, University of Oxford

Divya Narendra
Status: Enemy
Age: 29
Residence: Chicago, IL
Education: AB, Harvard University; JD, MBA, Northwestern University (expected 2012)

jueves, 29 de marzo de 2012

All Facebook Pages Will Automatically Change to Timeline On March 30th! What You Need To Do Today.

We shared the exciting updates from Facebook regarding the new Timeline capabilities for Fan Pages a few weeks back. It was a voluntary option back then. But, as of tomorrow, all fan Pages will become Timeline.

Publish your new fan Page Timeline by tomorrow, or Facebook will automatically create a default for you.

So now is the time! Go to your Page on Facebook (log in as yourself) and hit Publish Now.

Here’s an example, showing the transition from our old Webtrends Page to our new Timeline:

What You Need To Do

Below is a list of the Timeline features you should incorporate that will help you pump up your Page, and ultimately help boost your fan engagement:

1.Upload a Cover Photo

The cover photo is a prominent, eye-candy picture that displays on top of your Timeline Page. It can be up to 851px by 315px. Be mindful of Facebook’s policies about your cover photo.Cover photos cannot include:

  • Price or purchase information, such as “40% off” or “Download it at our website”.
  • Contact information such as a website address, email, mailing address, or information that should go in your Page’s “About” section.
  • References to Facebook features or actions, such as “Like” or “Share” or an arrow pointing from the cover photo to any of these features.
  • Calls to action, such as “Get it now” or “Tell your friends”.
  • Covers must not be false, deceptive or misleading, and must not infringe on third parties’ intellectual property
2.‘Pin’ or ‘Highlight’ your most important or engaging posts, each week

Hover over a story (any type of Facebook post: status update, photo, link, video) and ‘pin’ it so it displays at the top of your Timeline. Posts can stay ‘pinned’ for up to 7 days, so make sure to repeat the process every week with different featured posts. You can also click on the star icon on top right corner of a story to ‘Highlight’ a post, which will enlarge that post to the full width of your Timeline.

3. Select the order of your App icons

Photos, Likes, Events and Apps are now found at the top of your Page, directly under the cover photo, showing as App icons that users can click on. You can customize the position of these App icons (Photos is a default App that you cannot move) and display 3 additional Apps of your choice that will be featured here. Users can click on an arrow to browse through your additional Apps, up to a maximum of 12 .

4.Update your App thumbnails

With Timeline, your App thumbnail is no longer 75×75 pixels but displays as a 111x74px image. You can adjust these images by clicking to ‘Manage’ from the Admin Panel, choose ‘Edit Page’ in the drop-down menu. Under the ‘Apps’ section, click ‘Edit Settings’ for the specific app image you’d like to adjust and it will allow you to change the image, and the name of that App.

5.Take advantage of the larger App width

The width of the new tabs are 810px by default, and Apps can either be set to 520px or 810px wide on a Page tab now. To take advantage of this full width, publish your App in the WebTrends Social platform using the Advanced Publish flow. Then, make sure to update your App Settings on Facebook by selecting the ‘Wide’ (810px) option in the Developer App (https://developers. facebook.com/apps) under ‘Edit App’. If you have published your Apps with the Easy Publish flow, they will still be displayed with the narrow width of 520px (centered in the Page tab). We will soon update this to 810px wide and notify you prior to the change.
We encourage you to start updating your apps to the full 810px width now!

6. Manage your Page through the Admin Panel

Use the Admin Panel to view Page Insights and keep track of new activity on your fan Page. Facebook users (whether they are your Page fans or not) can now contact you privately using direct messages. Notifications about new messages will appear right in your Admin Panel. Make sure to respond promptly to your users and keep your community management going!


Entradas populares