Linux: Instalando o XAMPP

[Fontes: http://www.apachefriends.org/en/xampp-linux.html, http://preprocess.me/how-to-run-xampp-on-64-bit-linux e http://yeslinux.blogspot.com.br/2011/09/xampp-on-64-unix-operating-systems.html]

Para instalar o XAMPP basta descompactar seus arquivos na pasta /opt. Em alguns casos, ao inicializar o XAMPP, ele pode exibir uma mensagem de erro informando que não é possível executá-lo em sistemas 64-bit. Para resolver isso no Ubuntu, execute

sudo apt-get install ia32-libs

Para resolver esse problema em outros sistemas, consulte os links usados como fonte.

Ubuntu: Habilitando hibernação

Fonte: http://askubuntu.com/questions/94754/how-to-enable-hibernation

You can follow official documentation here.

Before enabling hibernation, please try to test whether it works correctly by running pm-hibernate in a terminal. The system will try to hibernate. If you are able to start the system again then you are more or less safe to add an override.

To do so, start editing

sudoedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla 

Fill it with this

[Re-enable hibernate by default] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes

Save by pressing Ctrl-O and exit nano by pressing Ctrl-X

Restart and hibernation is back!

Or run unity --reset to just reset the menu (note that this will wipe all your compiz customisations!).

[NE: O comando unity --reset foi removido no Ubuntu 12.10.]

Some users will then need to run sudo update-grub to get the hibernate option to be available in the power menu..

Ubuntu: Instalando o Adobe Flash

Fonte: http://www.liberiangeek.net/2012/04/install-adobe-flash-reader-air-in-ubuntu-12-04-precise-pangolin/

Execute o comando abaixo para alterar os repositórios da instalação

sudo apt-add-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"

Execute o comando abaixo para atualizar os repositórios e instalar o Flash

sudo apt-get update && sudo apt-get install flashplugin-installer

GIT: Iniciando um repositório com servidor remoto

Depois de criar o repositório no servidor remoto, siga os passos abaixo.

  1. Crie o diretório local do repositório
    $ mkdir /path/to/your/project
  2. Dentro do diretório do repositório inicialize o Git
    $ cd /path/to/your/project
    $ git init
  3. Adicione o repositório remoto
    $ git remote add origin https://<username>@bitbucket.org/<repo_owner>/<project_name>.git
  4. Por fim, baixe o código do repositório, caso haja
    $ git pull “origin” master

Fonte: BitBucket website

Ubuntu: Colocando o Ubuntu 12 no AD do Windows

[Fonte: http://jamesisin.com/a_high-tech_blech/index.php/2011/12/attach-ubuntu-to-windows-domain-via-active-directory-sudo/]

 

There may not be too many advantages to adding your Ubuntu machines to your Windows domain, but if you think of them this will allow you to work toward them.  It’s actually pretty easy to add a Linux box to Active Directory.  This is true because AD started out life as an LDAP server and it still retains its LDAP genes somewhere deep inside its withered exterior.

First thing you will want to do is add this utility to your Ubuntu machine:

sudo apt-get install likewise-open

It will allow you to authenticate against AD using Kerberos.  If you don’t know what that means it’s not important at this stage; it’s enough to understand that it’s a secure method for assuring identity between your client machine and your AD server.

I then added the machine to the domain.  Again this is a simple operation.  Before you do anything on the Ubuntu machine, hop into Active Directory and create a machine account in the name of the Ubuntu machine.  Then back on the Ubuntu machine it’s one line of code:

sudo domainjoin-cli join [domain.name] [username]

Easy enough.

Further I added a domain group to the local sudo group by adding these lines to the /etc/sudoers file:

# Active Directory group [groupname] given sudo privs
%[domain.name]\\[groupname] ALL=(ALL) ALL

OBS: Entrada testada: %ICA\\Domain^Admins ALL=(ALL) ALL

If you don’t know how to edit a protected file like /etc/sudoers I recommend using Gedit:

gksudo gedit /etc/sudoers

Just add those two lines to the end of the file.  The first line is just a comment line and could say something different.  Replace those items in the square brackets with the appropriate information to your network.

For the group I created in Active Directory to grant these sudo privileges I included Domain Administrators and a couple of individuals who would likely be using the Ubuntu box and need sudo rights.  If you’d rather you could substitute a username for the groupname in the edit above, but I think it’s better to use a security group in AD since you’re now attached to it.

Anyway, that’s about it.  Not too exciting but sure it’s useful for something.  Have fun with it.

(The same can be done with Macs or probably any Unix-like system as long as it can authenticate against an LDAP.  Of course for other systems the details will be, you know, different.)

MongoDB: Instalação no Ubuntu

[Fonte: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/]

Other installation tutorials:

Synopsis

This tutorial outlines the basic installation process for installing MongoDB on Ubuntu Linux systems. This tutorial uses .deb packages as the basis of the installation. 10gen publishes packages of the MongoDB releases as .deb packages for easy installation and management for users of Ubuntu systems. Ubuntu does include MongoDB packages, the 10gen packages are generally more up to date.

This tutorial includes: an overview of the available packages, instructions for configuring the package manager, the process for installing packages from the 10gen repository, and preliminary MongoDB configuration and operation.

Note: If you use an older Ubuntu that does not use Upstart, (i.e. any version before 9.10 “Karmic”) please follow the instructions on the Install MongoDB on Debian tutorial.

Package Options

The 10gen repository contains three packages:

  • mongodb-10gen: This package contains the latest stable release. Use this for production deployments.
  • mongodb20-10gen: This package contains the stable release of v2.0 branch.
  • mongodb18-10gen: This package contains the stable release of v1.8 branch.

You cannot install these packages concurrently with each other or with the mongodb package that your release of Ubuntu may include.

10gen also provides packages for “unstable” or development versions of MongoDB. Use the mongodb-10gen-unstable package to test the latest development release of MongoDB, but do not use this version in production.

Installing MongoDB

Configure Package Management System (APT)

The Ubuntu package management tool (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command to import the 10gen public GPG Key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

[Obs: If you have problems running this command follow http://askubuntu.com/questions/134913/cant-add-repo-keys]

Create the /etc/apt/sources.list.d/10gen.list file and include the most appropriate version of the following lines for the 10gen repository.

deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

Now issue the following command to reload your repository:

sudo apt-get update

Install Packages

Issue the following command to install the latest stable version of MongoDB:

sudo apt-get install mongodb-10gen

When this command completes, you have successfully installed MongoDB! Continue for configuration and start-up suggestions.

Configure MongoDB

These packages configure MongoDB using the /etc/mongodb.conf file in conjunction with the control script. You will find the control script is at/etc/init.d/mongodb.conf.

This MongoDB instance will store its data files in the /var/lib/mongodb and its log files in /var/log/mongodb, and run using the mongodb user account.

Note: If you change the user that runs the MongoDB process, you will need to modify the access control rights to the /var/lib/mongodb and/var/log/mongodb directories.

Controlling MongoDB

Starting MongoDB

You can start the mongod process by issuing the following command:

sudo service mongodb start

You can verify that mongod has started successfully by checking the contents of the log file at /var/log/mongodb/mongodb.log.

Stopping MongoDB

As needed, you may stop the mongod process by issuing the following command:

sudo service mongodb stop

Restarting MongoDB

You may restart the mongod process by issuing the following command:

sudo service mongodb restart

Controlling mongos

As of the current release, there are no control scripts for mongosmongos is only used in sharding deployments and typically do not run on the same systems where mongod runs. You can use the mongodb script referenced above to derive your own mongos control script.

Using MongoDB

Among the tools included with the MongoDB package, is the mongo shell. You can connect to your MongoDB instance by issuing the following command at the system prompt:

mongo

This will connect to the database running on the localhost interface by default. At the mongo prompt, issue the following two commands to insert a record in the “test” collection of the (default) “test” database.

> db.test.save( { a: 1 } )
> db.test.find()

 

Veja também:

Como executar um programa como outro usuário no Windows 8

Por padrão, o recurso de “Run as different user” vem desabilitado no Windows 8. Para habilitá-lo siga os passos abaixo.

  1. Execute o comando gpedit.msc (pode ser utilizando o Run, apertando tecla Windows + r.) para abrir o Local Group Policy Editor.
  2. No menu em árvore da janela que se abriu, caminhe até User Configuration\Administrative Templates\Start Menu and Taskbar.
  3. Na parte da direita, clique duas vezes sobre a opção Show “Run as different user” command on Start.
  4. Habilite o recurso na janela que se abriu e clique em ok para confirmar a mudança e feche a janela do Local Group Policy Editor.
  5. Para que a alteração entre em vigor, execute o comando gpupdate /force (como no passo 1).

Fontes:

  1. http://www.howtogeek.com/114708/how-to-run-windows-8-apps-as-a-different-user-from-the-start-screen/
  2. http://www.ghacks.net/2012/08/05/add-run-as-different-user-to-the-windows-8-startpage/

Como alterar a chave do Windows 8

  1. Execute o prompt como administrador (Na tela inicial, digite cmd. Clique com o botão direito do mouse em Command Promt e depois, no rodapé, em Run as administrator).
  2. No prompt, digite o comando slmgr.vbs -ipk CHAVE-DE-ATIVAÇÃO.
  3. Você vai receber um alerta confirmando a mudança.
  4. Depois, para fazer a ativação com a nova chave, digite o comando slmgr.vbs -ato.
  5. Por último, reinicie o computador.

Uma outra maneira, não testada ainda, é utilizar o comando slui 3.

Fontes: