jueves, 30 de abril de 2015

How-to: Install Cloudera Navigator Encrypt 3.7.0 on SUSE 11 SP2 and SP3



Original post can be found at: hhttp://blog.cloudera.com/blog/2015/04/how-to-install-cloudera-navigator-encrypt-3-7-0-on-suse-11-sp2-and-sp3/


--------------------------------------------------------------------------------------------------------------


How-to: Install Cloudera Navigator Encrypt 3.7.0 on SUSE 11 SP2 and SP3

Installing Cloudera Navigator Encrypt on SUSE is a one-off process, but we have you covered with this how-to.
Cloudera Navigator Encrypt, which is integrated with Cloudera Navigator governance software, provides massively scalable, high-performance encryption for critical Apache Hadoop data. It leverages industry-standard AES-256 encryption and provides a transparent layer between the application and filesystem. Navigator Encrypt also includes process-based access controls, allowing authorized Hadoop processes to access encrypted data, while simultaneously preventing admins or super-users like root from accessing data that they don’t need to see.
Navigator Encrypt is distributed in two different packages: the kernel module, and the binaries (cli commands) and configuration files. Current supported distributions are debian-7-x64, rhel-5-x64, rhel-6-x64, sles-11-x64, ubuntu-12.04-x64, and ubuntu-14.04-x64. As SUSE has a specific way to build and distribute RPMs for any external kernel module, this post explains how to install Navigator Encrypt 3.7.0 specifically on SLES 11 SP2 and SP3.

Understanding KMPs

For nearly all platforms, the traditional way to install Navigator Encrypt and its kernel module is to issue:
or any package manager equivalent. In these cases, the Navigator Encrypt kernel module uses dkms to build the kernel module at installation time.
This strategy doesn’t work with SUSE, however, which doesn’t support dkms and which handles external kernel modules in a unique manner. Because the process to build the kernel module manually is tedious, the easiest way to install the kernel module is by distributing it already built.
Fortunately, SUSE provides a build tool (openSUSE Build Service, or OBS) that creates RPM packages containing the pre-built kernel module; this tool is free and can be found at build.opensuse.org. A SUSE package created with this tool is called a kernel module package (KMP). (To learn more about how to build KMPs, see the openSUSE build service user guide.)
For KMP names, SUSE recommends using a naming convention based on the company name and a short package name (example: cloudera-zncryptfs-kmp-default-3.4.2_3.0.13_0.27-15.1.x86_64.rpm). To clarify which packages belong to SP2 and SP3, Cloudera has renamed the KMP by adding “SPx” to the package name, as in:cloudera-zncryptfs-kmp-SP2-default-3.4.2_3.0.13_0.27-15.1.x86_64.rpm.
KMPs are designed to maintain compatibility among all kernel versions for a specific SUSE version (SP2, SP3, etc.). SUSE assures us that if there is a kernel upgrade the kABI symbols will not change; those symbols will have the same symbol version (checksum) for all the kernels supported for a specific SUSE Version (SP2, for example). Thus the same installed kernel module will work after the upgrade without the need to rebuild or upgrade it.
A Navigator Encrypt kernel module only needs to be re-installed when there is an upgrade from SP2 to SP3. The reason for that re-install is that the SP2 cloudera-zncryptfs kernel module is incompatible with SP3—instead, you would need to install the SP3 cloudera-zncryptfs KMP.
Navigator Encrypt for SUSE doesn’t have an implicit dependency on the zncrypt-kernel-module anymore, so it has to be installed independently and based on the kernel where it is going to run. Cloudera packages are named to make it easy to know which version to use; for example, the package cloudera-zncryptfs-kmp-SP2-default-3.4.2_3.0.13_0.27-15.1.x86_64.rpm corresponds to SP2 and cloudera-zncryptfs-kmp-SP3-default-3.4.2_3.0.76_0.11-10.2.x86_64.rpm corresponds to SP3.
SUSE also maintains a list of supported kernels and their versions that you can use to verify compatibility between the KMP version and your installed kernel. Just select the service pack that interests you and then click on the “Kernel:” drop-down list to see all the kernels. (Note: the latest SP3 kernel update used slightly different numbers for i586 vs. x86_64 architectures. The update released for i586 was 3.0.101-0.42.1, and the update released for x86_64 was 3.0.101-0.46.1. This is why you see both in the list. Anyway, for an SP3 kernel x86_x64, you will never see a 3.0.101-0.42.1 version. Navigator Encrypt only supports x86_64.)
Cloudera is a SUSE partner and thus cloudera-zncryptfs is part of the Solid Driver Program, ensuring kernel driver compatibility. To check if the SUSE kernel is tainted, look at the variable:
where 0 means the kernel is not tainted. However, because cloudera-zncryptfs is a supported kernel module, a tainted kernel is tagged with a specific value:
(To learn more about a tainted kernel here.)
When looking at the kernel module info, you will also see that it has a tag identifying the support as external to SUSE (“supported:  external”).
Currently, Navigator Encrypt supports SUSE 11 SP2 and SP3. (SLES 11 SP1 is not supported, nor is SLES 12.) The Cloudera stable repo for SUSE/OpenSUSE can be found at here.
Here is a list of cloudera-zncryptfs KMPs built for SP2:
cloudera-zncryptfs-kmp-SP2-default-3.4.2_3.0.13_0.27-15.1.x86_64.rpm
cloudera-zncryptfs-kmp-SP2-xen-3.4.2_3.0.13_0.27-15.1.x86_64.rpm    
cloudera-zncryptfs-kmp-SP2-ec2-3.4.2_3.0.13_0.27-15.1.x86_64.rpm    
And here is a list of cloudera-zncryptfs KMPs built for SP3:
cloudera-zncryptfs-kmp-SP3-default-3.4.2_3.0.76_0.11-10.2.x86_64.rpm
cloudera-zncryptfs-kmp-SP3-xen-3.4.2_3.0.76_0.11-10.2.x86_64.rpm 
cloudera-zncryptfs-kmp-SP3-ec2-3.4.2_3.0.76_0.11-10.2.x86_64.rpm
What flavor is your kernel? It mostly depends on your hardware. Learn more about kernel flavors here.

Installation Process

Identify the cloudera-zncryptfs KMPs that you will install for SP2 or SP3. You also need to identify the flavor.
Add the cloudera archive as specified in the Navigator Encrypt user guide:
In this example, we are installing Navigator Encrypt for SLES 11 SP3. Let’s install its corresponding KMP:
(Note: The previous command-line example is for the build revision number 14.13. That number might change, so please check the stable repo for the newest build.)
zncryptfs.ko is installed at /lib/modules/3.0.76-0.11-default/updates/zncryptfs.ko and it becomes a weak-update of your current kernel module.
Current kernel module in this example is:
The weak-update has now a symlink to the kernel module installed:
This is a good moment to check for the modinfo of our installed kernel module:
Our module is now ready to work on our installed kernel. Next, we can install the Navigator Encrypt binaries:
You can register Navigator Encrypt against a Key Trustee server:
SUSE has a flag that allows external kernel modules to load. Set this flag to 1 as specified in the user guide:
If you don’t do that, you won’t be able to prepare any mount point, and a message like the following will appear:
Then, prepare a first mount point:
Verify that it is actually mounted:
A quick encryption test adding a universal rule can be done:
Congratulations, you have just installed Navigator Encrypt on SLES 11 SP3!
Alex Gonzalez is a Software Engineer at Cloudera.

P.D. You can have yor own miniature f

miércoles, 21 de enero de 2015

Supporting a kernel module on SUSE - Solid Driver Program


SUSE Solid Driver Program

You probably want to support your kernel module on SUSE, to successfully achieve that goal you can contact a SUSE representative.

In short you just need a flag added to your kernel module, there are two easy methods that I can't expose unfortunatly but Your mod info will look like this:

sles-ec2:/usr/src/zncryptfs-3.4.2 # modinfo zncryptfs.ko
filename:       zncryptfs.ko
suse_support_flag:      value_of_suse_support_tag
license:        GPL v2
description:    zncryptfs (v3.4.2-1024)
author:         Sergio Pena <sergio.pena@cloudera.com>
srcversion:     C061C84F42263E55560266A
depends:       
vermagic:       3.0.101-0.7.17-ec2 SMP mod_unload modversions Xen
parm:           zncryptfs_stats_enabled:Enable data statistics (int)
parm:           zncryptfs_acl_cache_size:Set ACL cache size (int)
parm:           zncryptfs_acl_verbose:Display more information on an access denied (int)
parm:           zncryptfs_debug:Display debug information (int)
sles-ec2:/usr/src/zncryptfs-3.4.2 #



The tainted kernel flag will still be dirty, but SUSE engineers will know how to deal with that and if there is an error caused by your kernel module, then they will let you know:

sles-ec2:/usr/src/zncryptfs-3.4.2 # cat /proc/sys/kernel/tainted
2847453646


You can find all information about this program at:

http://drivers.suse.com/doc/SolidDriver_Compliance/

http://wiki.novell.com/index.php?title=Category:Partner_Linux_Driver_Program

http://drivers.suse.com/doc/SolidDriver/

Enjoy!
P.S. You can create your own flag

martes, 20 de enero de 2015

Building a kernel module on SLES 11 SP3



Building a kernel module on SLES 11 SP3

In this example I am using zncryptfs kernel module from Cloudera/Gazzang repo.

[root@hive-1 ~]# zypper install zncrypt-kernel-module

This will ask you to install a kernel module that doesn’t have the ‘dkms’ dependency, we will install the kernel module breaking that dependency:

Problem: nothing provides dkms needed by zncrypt-kernel-module-3.4.2_SLES11-1024.x86_64
Solution 1: do not install zncrypt-kernel-module-3.4.2_SLES11-1024.x86_64
Solution 2: break zncrypt-kernel-module-3.4.2_SLES11-1024.x86_64 by ignoring some of its dependencies

Choose from above solutions by number or cancel [1/2/c] (c): 2

Select option 2.

3.1.2 Update to the latest kernel module

Update the kernel:
hive-ne-SLES-1:~ # zypper install -y kernel-default
Several operations

Then reboot; the kernel version should be updated after reboot.

hive-ne-SLES-1:~ # uname -r
3.0.101-0.40-default



kernel module needs to be build manually 
then:
First requirement to build the kernel module is to have the kernel headers installed, to install them check the kernel version and install its kernel headers accordingly:


hive-ne-SLES-1:~ #zypper install -y kernel-default-devel
…..
Several operations
….

Once the kernel headers are installed you will see the include files at /usr/src/linux-3.0.101-0.40/include; then go to the zncrypt kernel module source code directory to build it.

hive-ne-SLES-1:~ # cd /usr/src/zncryptfs-3.4.2/

You may have the following error message:
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # make
Searching known bugs on kernel...
make -C /lib/modules/3.0.101-0.40-default/build M=/usr/src/zncryptfs-3.4.2 modules
make: *** /lib/modules/3.0.101-0.40-default/build: No such file or directory.  Stop.
make: *** [all] Error 2
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 #

To fix previous error create a symlink from /lib/modules/$(uname -r)/build to the x86_64 obj headers directory, then execute again make

hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # ln -s /usr/src/linux-3.0.101-0.40-obj/x86_64/default/ /lib/modules/$(uname -r)/build
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # make
Searching known bugs on kernel...
make -C /lib/modules/3.0.101-0.40-default/build M=/usr/src/zncryptfs-3.4.2 modules
make[1]: Entering directory `/usr/src/linux-3.0.101-0.40-obj/x86_64/default'
make -C ../../../linux-3.0.101-0.40 O=/usr/src/linux-3.0.101-0.40-obj/x86_64/default/. modules
 CC [M]  /usr/src/zncryptfs-3.4.2/main.o
 CC [M]  /usr/src/zncryptfs-3.4.2/hooks.o
 CC [M]  /usr/src/zncryptfs-3.4.2/messaging.o
 CC [M]  /usr/src/zncryptfs-3.4.2/auth.o
 CC [M]  /usr/src/zncryptfs-3.4.2/acl.o
 CC [M]  /usr/src/zncryptfs-3.4.2/profile.o
 CC [M]  /usr/src/zncryptfs-3.4.2/stats.o
 CC [M]  /usr/src/zncryptfs-3.4.2/procfs.o
 CC [M]  /usr/src/zncryptfs-3.4.2/timeconv.o
 CC [M]  /usr/src/zncryptfs-3.4.2/debug.o
 LD [M]  /usr/src/zncryptfs-3.4.2/zncryptfs.o
 Building modules, stage 2.
 MODPOST 1 modules
 CC      /usr/src/zncryptfs-3.4.2/zncryptfs.mod.o
 LD [M]  /usr/src/zncryptfs-3.4.2/zncryptfs.ko
make[1]: Leaving directory `/usr/src/linux-3.0.101-0.40-obj/x86_64/default'
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 #

At this point the kernel module is build you can see it at /usr/src/zncryptfs-3.4.2/zncryptfs.ko

3.1.3 Load the module

hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # depmod -a
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # modprobe zncryptfs
FATAL: Module zncryptfs not found.
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 #

That error means that the kernel module is not part of the modules of the current kernel $(uname -r).

To fix that a symlink needs to be created to point to this kernel module or it can be copied.

hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # ln -s /usr/src/zncryptfs-3.4.2/zncryptfs.ko /lib/modules/$(uname -r)/
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # depmod -a
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # modprobe zncryptfs
FATAL: module '/lib/modules/3.0.101-0.8-default/zncryptfs.ko' is unsupported
Use --allow-unsupported or set allow_unsupported_modules to 1 in
/etc/modprobe.d/unsupported-modules
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 #

This is the last error we might see, it refers that the policy to allow unsupported modules, just change the variable of the config file as indicated (set allow_unsupported_modules to 1) :

hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # vi /etc/modprobe.d/unsupported-modules

Then run:

hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # depmod -a
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # modprobe zncryptfs
hive-ne-SLES-1:/usr/src/zncryptfs-3.4.2 # lsmod | grep zncrypt
zncryptfs              82143  0


The module is loaded and ready to be used

Enjoy!
P.S. There is a Queen that has her own flag

jueves, 15 de enero de 2015

Install gpgme-devel on redhat 7


4 commands are needed:

Need to install rpmforce and gpgme03-devel

# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

# rpm -Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

# wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

# rpm --import RPM-GPG-KEY.dag.txt

# yum install gpgme03-devel



Executing those commands you get:


[root@rhel7 navencrypt]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
--2015-01-15 09:27:57--  http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
Resolving pkgs.repoforge.org (pkgs.repoforge.org)... 78.46.17.228
Connecting to pkgs.repoforge.org (pkgs.repoforge.org)|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://rpmforge.sw.be/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm [following]
--2015-01-15 09:27:57--  http://rpmforge.sw.be/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
Resolving rpmforge.sw.be (rpmforge.sw.be)... 78.46.17.228
Connecting to rpmforge.sw.be (rpmforge.sw.be)|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://tree.repoforge.org/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm [following]
--2015-01-15 09:27:58--  http://tree.repoforge.org/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
Resolving tree.repoforge.org (tree.repoforge.org)... 78.46.17.228
Connecting to tree.repoforge.org (tree.repoforge.org)|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://apt.sw.be/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm [following]
--2015-01-15 09:27:58--  http://apt.sw.be/redhat/el7/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
Resolving apt.sw.be (apt.sw.be)... 193.1.193.67
Connecting to apt.sw.be (apt.sw.be)|193.1.193.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12520 (12K) [application/x-redhat-package-manager]
Saving to: ‘rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm’

100%[==========================================================================================================================================================================================================================================>] 12,520      39.9KB/s   in 0.3s  

2015-01-15 09:27:59 (39.9 KB/s) - ‘rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm’ saved [12520/12520]

[root@rhel7 navencrypt]# rpm -Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
warning: rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:rpmforge-release-0.5.3-1.el7.rf  ################################# [100%]
[root@rhel7 navencrypt]# wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
--2015-01-15 09:28:17--  http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
Resolving dag.wieers.com (dag.wieers.com)... 148.251.123.139
Connecting to dag.wieers.com (dag.wieers.com)|148.251.123.139|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://dag.wiee.rs/rpm/packages/RPM-GPG-KEY.dag.txt [following]
--2015-01-15 09:28:17--  http://dag.wiee.rs/rpm/packages/RPM-GPG-KEY.dag.txt
Resolving dag.wiee.rs (dag.wiee.rs)... 148.251.123.139
Connecting to dag.wiee.rs (dag.wiee.rs)|148.251.123.139|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://apt.sw.be/RPM-GPG-KEY.dag.txt [following]
--2015-01-15 09:28:18--  http://apt.sw.be/RPM-GPG-KEY.dag.txt
Resolving apt.sw.be (apt.sw.be)... 193.1.193.67
Connecting to apt.sw.be (apt.sw.be)|193.1.193.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1672 (1.6K) [text/plain]
Saving to: ‘RPM-GPG-KEY.dag.txt’

100%[==========================================================================================================================================================================================================================================>] 1,672       --.-K/s   in 0s     

2015-01-15 09:28:18 (179 MB/s) - ‘RPM-GPG-KEY.dag.txt’ saved [1672/1672]

[root@rhel7 navencrypt]# rpm --import RPM-GPG-KEY.dag.txt
[root@rhel7 navencrypt]# yum search gpgme-devel
Loaded plugins: amazon-id, rhui-lb
Warning: No matches found for: gpgme-devel
No matches found
[root@rhel7 navencrypt]# yum search gpg
Loaded plugins: amazon-id, rhui-lb
================================================================================================================================= N/S matched: gpg =================================================================================================================================
kgpg.x86_64 : Manage GPG encryption keys
gpgme.i686 : GnuPG Made Easy - high level crypto API
gpgme03-devel.x86_64 : Static libraries and header files from GPGME, GnuPG Made Easy
libgpg-error.i686 : Library for error values used by GnuPG components
libgpg-error-devel.i686 : Development files for the libgpg-error package
libgpg-error-devel.x86_64 : Development files for the libgpg-error package
mingw32-libgpg-error.noarch : MinGW Windows libgpg-error compression library for the win32 target
mingw32-libgpg-error-static.noarch : Static library for mingw32-libgpg-error development
mingw64-libgpg-error.noarch : MinGW Windows libgpg-error compression library for the win64 target
mingw64-libgpg-error-static.noarch : Static library for mingw64-libgpg-error development
perl-Crypt-GPG.noarch : Object Oriented Interface to GnuPG
gpgme.x86_64 : GnuPG Made Easy - high level crypto API
gpgme03.x86_64 : GnuPG Made Easy
libgpg-error.x86_64 : Library for error values used by GnuPG components
nasty.x86_64 : Recover the passphrase of a PGP or GPG key
perl-Crypt-RSA.noarch : RSA public-key cryptosystem
perl-GnuPG-Interface.noarch : Perl interface to GnuPG
perl-Mail-GPG.noarch : Handling of GnuPG encrypted / signed mails
perl-Mail-GnuPG.noarch : Process email with GPG
pygpgme.x86_64 : Python module for working with OpenPGP messages
python-GnuPGInterface.noarch : A Python module to interface with GnuPG
python-pgpdump.noarch : PGP packet parser library in Python 2.x
seahorse.x86_64 : A GNOME application for managing encryption keys
thunderbird-enigmail.x86_64 : Authentication and encryption extension for Mozilla Thunderbird

  Name and summary matches only, use "search all" for everything.
[root@rhel7 navencrypt]# yum install gpgme03-devel
Loaded plugins: amazon-id, rhui-lb
Resolving Dependencies
--> Running transaction check
---> Package gpgme03-devel.x86_64 0:0.3.16-1.el6.rf will be installed
--> Processing Dependency: gpgme03 = 0.3.16 for package: gpgme03-devel-0.3.16-1.el6.rf.x86_64
--> Processing Dependency: libgpgme.so.6()(64bit) for package: gpgme03-devel-0.3.16-1.el6.rf.x86_64
--> Running transaction check
---> Package gpgme03.x86_64 0:0.3.16-1.el6.rf will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================================================================================================================
 Package                                                              Arch                                                          Version                                                                   Repository                                                       Size
====================================================================================================================================================================================================================================================================================
Installing:
 gpgme03-devel                                                        x86_64                                                        0.3.16-1.el6.rf                                                           rpmforge                                                        119 k
Installing for dependencies:
 gpgme03                                                              x86_64                                                        0.3.16-1.el6.rf                                                           rpmforge                                                        161 k

Transaction Summary
====================================================================================================================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total size: 280 k
Installed size: 792 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : gpgme03-0.3.16-1.el6.rf.x86_64                                                                                                                                                                                                                                   1/2
  Installing : gpgme03-devel-0.3.16-1.el6.rf.x86_64                                                                                                                                                                                                                             2/2
  Verifying  : gpgme03-devel-0.3.16-1.el6.rf.x86_64                                                                                                                                                                                                                             1/2
  Verifying  : gpgme03-0.3.16-1.el6.rf.x86_64                                                                                                                                                                                                                                   2/2

Installed:
  gpgme03-devel.x86_64 0:0.3.16-1.el6.rf                                                                                                                                                                                                                                           

Dependency Installed:
  gpgme03.x86_64 0:0.3.16-1.el6.rf                                                                                                                                                                                                                                                 

Complete!
[root@rhel7 navencrypt]#

P.S. Libya and Burma changed their flags recently

sábado, 16 de agosto de 2014

How to install Django and its virtual-env




1.

#sudo apt-get install python-setuptools

2. Instal virtual environment

sudo easy_install virtualenv==1.10.1

(or a more recent version)

3. Create a virtual environment the name of mine is 'dd'

#virtualenv --no-site-packages dd

4. Activate the virtual enviroment, you have to do this everytime you want to start your server.

#source dd/bin/activate

5.

You will see now that at the left of your prompy the virtualenv is activated

(dd)#

7. Go to dd directory which is our root system for the created virtual env

# cd dd

6. It is time to install Django

#easyinstall Django


7. Once installed you can find some django scripts in bin directory:

(dd)alex@tic:~/dd$ pwd
/home/alex/dd
(dd)alex@tic:~/dd$ ls bin/
activate       activate_this.py  easy_install-2.7  python
activate.csh   django-admin.py   pip               python2
activate.fish  easy_install      pip-2.7           python2.7
(dd)alex@tic:~/dd$


8. You can see the djanho help and its options

(dd)alex@tic:~/dd$ django-admin.py 
Usage: django-admin.py subcommand [options] [args]

Options:
  -v VERBOSITY, --verbosity=VERBOSITY
                        Verbosity level; 0=minimal output, 1=normal output,
                        2=verbose output, 3=very verbose output
  --settings=SETTINGS   The Python path to a settings module, e.g.
                        "myproject.settings.main". If this isn't provided, the
                        DJANGO_SETTINGS_MODULE environment variable will be
                        used.
  --pythonpath=PYTHONPATH
                        A directory to add to the Python path, e.g.
                        "/home/djangoprojects/myproject".
  --traceback           Raise on exception
  --version             show program's version number and exit
  -h, --help            show this help message and exit

Type 'django-admin.py help <subcommand>' for help on a specific subcommand.

Available subcommands:

[django]
    check
    cleanup
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    runfcgi
    runserver
    shell
    sql
    sqlall
    sqlclear
    sqlcustom
    sqldropindexes
    sqlflush
    sqlindexes
    sqlinitialdata
    sqlsequencereset
    startapp
    startproject
    syncdb
    test
    testserver
    validate
(dd)alex@tic:~/dd$


9. Create a new Django project:

#(dd)alex@tic:~/dd$ django-admin.py startproject first_project
(dd)alex@tic:~/dd$ ls f*
first_project  manage.py
(dd)alex@tic:~/dd$

10. Go to yout new project directory and runserver:

(dd)alex@tic:~/dd$ cd first_project/
(dd)alex@tic:~/dd/first_project$ ls
first_project  manage.py
(dd)alex@tic:~/dd/first_project$ python manage.py runserver
Validating models...

0 errors found
August 17, 2014 - 01:00:09
Django version 1.6.5, using settings 'first_project.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

11. Go to your web browser and type the address shown above:

http://127.0.0.1:8000/

You will see something like:

It worked!

Congratulations on your first Django-powered page.

Of course, you haven't actually done any work yet. Next, start your first app by running python manage.py startapp [appname].
You're seeing this message because you have DEBUG = True in your Django settings file and you haven't configured any URLs. Get to work!

12. Hit Ctrl+C to stop your server 

13. end your virtual environment session 
#deactivate and you will loose the (dd) environment from step 5


Enjoy!
.Alex

P.S. The first flags were used to assist military co-ordination on battlefields

Installing GIT on Mac snow Leopard


I am probably save you some time .. This is a response I verified on:

https://help.github.com/articles/does-github-for-mac-run-on-os-x-10-7-lion

Does GitHub for Mac run on OS X 10.6 Snow Leopard?
No, GitHub for Mac requires OS X 10.7 (Lion) or higher.
We made this decision because the app relies on a number of technologies which are not available in Mac OS X 10.6 or earlier. We want to provide the best experience possible for the app's users, so we've made the choice to only support 10.7 and above, and not make earlier versions available.

Normally I would do something like (but doesn't work):

http://git-scm.com/download

Then choose Mac OS X for example

The snow leopard version is compatible with Lion.

Your dmg files starts downloading. then just install it.

Restart bash sessions
------------------------------
This include GNU screen sessions, TMUX sessions, etc.

Enjoy!.

P.S. There are some yellow flags!

Create a linux boot USB with OS X



1. Download the ISO you want

http://www.ubuntu.com/download/desktop

2. Insert the USB

3. Press Comand+space

4. Type "disk utility"

5. Select the USB

6. Click on erase

7. Go to Partition

8. Select 1 partition in the volume scheme

9. Go to options and make sure the GUID  Partition Table is selected.

10. Also make sure that the format is Mac OS Extended (journaled)

11. Download the iso you want to install, in my case I have ubuntu 14.04:

$ ls -l *.iso
-rw-r--r--@ 1 user  staff  1010827264 Jun 23 15:11 ubuntu-14.04-desktop-amd64.iso


12. Convert your iso to the right format. I am naming it ubu14.img
$ hdiutil convert -format UDRW -o ubu14.img ubuntu-14.04.1-desktop-amd64.iso
Reading Driver Descriptor Map (DDM : 0)…
Reading Ubuntu 14.04.1 LTS amd64         (Apple_ISO : 1)…
Reading Apple (Apple_partition_map : 2)…
Reading Ubuntu 14.04.1 LTS amd64         (Apple_ISO : 3)…
..............................................................................................................................................................
Reading EFI (Apple_HFS : 4)…
..............................................................................................................................................................
Reading Ubuntu 14.04.1 LTS amd64         (Apple_ISO : 5)…
....................................................................................................................................................................
Elapsed Time:  1m 25.631s
Speed: 11.5Mbytes/sec
Savings: 0.0%
created: /Users/user/Downloads/ubu14.img.dmg

13. You might se a .dmg extension attached to your converted file, in my case it is ubu14.img.dmg

$ ls ubu*
ubu14.img.dmg ubuntu-14.04-desktop-amd64.iso ubuntu-14.04.1-desktop-amd64.iso


14. Identify your USB device in this case /dev/disk1

$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS MacOSX                  300.0 GB   disk0s2
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *7.8 GB     disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS Untitled 1              7.5 GB     disk1s2


15. Umount your USB device:

$ diskutil umountDisk /dev/disk1
Unmount of all volumes on disk1 was successful

16. Write the iso to the usb

$ sudo dd if=ubu14.img.dmg of=/dev/rdisk1 bs=1m
Password:
981+0 records in
981+0 records out
1028653056 bytes transferred in 224.304496 secs (4585967 bytes/sec)

17. You might see a warning saying that the device is not readable, dont do anything you will close it later.

18. List and umount

$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS MacOSX                  300.0 GB   disk0s2
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *7.8 GB     disk1
   1:        Apple_partition_map                         4.1 KB     disk1s1
   2:                  Apple_HFS                         2.4 MB     disk1s2

$ diskutil umountDisk /dev/disk1
Unmount of all volumes on disk1 was successful


19. Then click on ignore on the warning dialog that says your device was not readable.

Finally remove your USB, it is ready to be used as a boot USB.

Enjoy!

P.S. Ubuntu flag?