Fun at work!

Archive for February, 2014

Link

Repost: Add a column to an existing MySQL table

Repost: Add a column to an existing MySQL table

MySQL tables are easy to extend with additional columns.

To add a column called email to the contacts table created in Create a basic MySQL table with a datatype of VARCHAR(80), use the following SQL statement:

ALTER TABLE contacts ADD email VARCHAR(60);

This first statement will add the email column to the end of the table. To insert the new column after a specific column, such as name, use this statement:

ALTER TABLE contacts ADD email VARCHAR(60) AFTER name;

If you want the new column to be first, use this statement:

ALTER TABLE contacts ADD email VARCHAR(60) FIRST;

– See more at: http://www.tech-recipes.com/rx/378/add-a-column-to-an-existing-mysql-table/#sthash.bGG7f6EK.dpuf

Link

Repost: How To Edit the Sudoers File on Ubuntu and CentOS

Repost: How To Edit the Sudoers File on Ubuntu and CentOS

Privilege separation is one of the fundamental security paradigms implemented in Linux and Unix-like operating systems. Regular users operate with limited privileges in order to reduce the scope of their influence to their own environment, and not the wider operating system.

A special user, called root, has “super-user” privileges. This is an administrative account without the restrictions that are present on normal users. Users can execute commands with “super-user” or “root” privileges in a number of different ways.

In this article, we will discuss how to correctly and securely obtain root privileges, with a special focus on editing the /etc/sudoers file.

We will be completing these steps on an Ubuntu 12.04 VPS, but most modern Linux distributions should operate in a similar manner.

This guide assumes that you have already completed the initial server setup discussed here. Log into your VPS as regular, non-root user.

Read more…

 

Find/grep command to find matching files

Find/grep command to find matching files, print filename, then print matching content

find . -type f -exec grep -H -n 'module' {} \;
Link

Repost: How to Install Red5 on CentOS

Repost: How to Install Red5 on CentOS

Red5 Media Server 1.0 delivers a powerful video streaming and multi-user solution to the ©Adobe ©Flash Player and other exciting client technologies. Based on Java and some of the most powerful open source frameworks, Red5 stands as a solid solution for business of all sizes including the enterprise.

Red5 includes support for the latest multi-user API’s including NetConnection, NetStream and SharedObject’s while providing a powerful RTMP / Servlet implementation. In addition to support for the RTMP protocol, the application server has an embedded Tomcat Servlet container for JEE Web Applications. Application development draws additional benefits from the Spring Framework and Scope based event driven services.

By using the Open Source Red5 Media Server, you are developing with a truly open and extensible platform that can be used in Video Conferences, Multi-User Gaming and Enterprise Application Software.  – Red5.org

Link

Repost: How To Set Up SSH Keys

Repost: How To Set Up SSH Keys

SSH keys provide a more secure way of logging into a virtual private server with SSH than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute force alone. Generating a key pair provides you with two long string of characters: a public and a private key. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When the two match up, the system unlocks without the need for a password. You can increase security even more by protecting the private key with a passphrase.

Read more…

Link

Repost: How to Sign a JAR File

Repost: How to Sign a JAR File

When JAR files need to be downloaded as part of a Java applet or Webstart deployment it is best to digitally sign the JAR files.

Signing with a Test Certificate

1. Make sure that you have a Java SDK keytool and jarsigner in your path. These tools are located in the Java SDK bin directory.

2. Create a new key in a new keystore as follows:

  keytool -genkey -keystore myKeystore -alias myself

You will be prompted for information regarding the new key, such as password, name, etc. This will create the myKeystore file on disk.

3. Then create a self-signed test certificate as follows:

  keytool -selfcert -alias myself -keystore myKeystore

This will prompt you for a password. Generating the certificate may take a few minutes.

4. Check to make sure that everything is okay. To list the contents of the keystore, use this command:

  keytool -list -keystore myKeystore

It should list something like:

  Keystore type: jks
  Keystore provider: SUN

  Your keystore contains 1 entry:
  myself, Tue Jan 23 19:29:32 PST 2001, keyEntry,
  Certificate fingerprint (MD5):
  C2:E9:BF:F9:D3:DF:4C:8F:3C:5F:22:9E:AF:0B:42:9D

5. Finally, sign the JAR file with the test certificate as follows:

  jarsigner -keystore myKeystore test.jar myself

6. Repeat these steps for all your JAR files.

Note that a self-signed test certificate should only be used for internal testing, since it does not guarantee the identity of the user and therefore cannot be trusted. A trustworthy certificate can be obtained from a certificate authority, such as VeriSign orThawte, and should be used when the application is put into production

Make sure you add the following tag to your .jnlp file:

  <security>
    <all-permissions/>
  </security>
Link

Repost: 20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management

Repost: 20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management

# yum install firefox
# yum remove firefox
# yum update mysql
# yum list openssh

# yum search vsftp

# yum info firefox

# yum list | less

# yum list installed | less

# yum provides /etc/httpd/conf/httpd.conf

# yum check-update

# yum update

# yum grouplist

# yum groupinstall 'MySQL Database'

# yum groupupdate 'DNS Name Server'

# yum groupremove 'DNS Name Server'

# yum repolist

# yum repolist all

# yum --enablerepo=epel install phpmyadmin

# yum shell

# yum clean all

# yum history


Tag Cloud