Install Django centos redhat

To install Django on Centos or Redhat

echo “Installing httpd and httpd-devel” yum -q -y –enablerepo=ius install httpd httpd-devel > /dev/null 2>&1 chkconfig httpd on sed -i ‘s/Listen 80/Listen 8080/g’ /etc/httpd/conf/httpd.conf service varnish start service httpd start To Install Python 2.7.2 on redhat or centos echo “Install Python 2.7.2” mkdir -p /usr/local/src/python.2.7.2.install cd /usr/local/src/python.2.7.2.install wget . . . → Read More: Install Django centos redhat

Install Python 2.7.2 redhat centos

To Install Python 2.7.2 on redhat or centos

echo “Install Python 2.7.2” mkdir -p /usr/local/src/python.2.7.2.install cd /usr/local/src/python.2.7.2.install wget “http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-linux-x86_64.tar.gz” tar xzvf ActivePython-2.7.2.5-linux-x86_64.tar.gz cd ActivePython-2.7.2.5-linux-x86_64 ./install.sh -I /opt/ActivePython-2.7

howto set up local svn repository

Objective

Set up a local svn repository to store some code

Install subversion yum install subversion Repository Setup

We will set up a path to store the repositories then create the initial repository

mkdir -p /usr/local/svn svnadmin create /usr/local/svn/repo1 Initial Import of content to the repository Linux/Unix svn import /path/to/files/to_checkin file:///usr/local/svn/repo1/trunk -m “first Import” Windows . . . → Read More: howto set up local svn repository

RHCSA Training Labs

These are some labs I have crafted to prep for the RHCSA exam. Hopefully you will find this useful!

Brakertech’s RHCSA Training Labs Objective: Configure NTP Client to sync against a custom NTP server Configure Local NTP Server

The first step is to get your local ntp server running

Install Required Package # yum install . . . → Read More: RHCSA Training Labs

Bash Server Backup Script

I’ve created a Bash Server Backup Script that will backup your MySQL databases (each database separately in to .sql and .xml files) and your main directories (/var/log, /var/www/html, /etc, /home, /root) to a timestamped directory. Feel free to re-use or hack up however you’d like

Here’s my Bash Server Backup Script: Download the script here

. . . → Read More: Bash Server Backup Script

Eric Wedaa’s notes on setting up centos 6.2

I just came across this page and thought i’d post it because it had some good content: # Eric Wedaa’s notes on setting up centos 6.2 # email [email protected] # # May 9-21, 2012 # # In general, I used mozilla to download the files into # /home/shepherd/Downloads # ###################################################################### # # date command for . . . → Read More: Eric Wedaa’s notes on setting up centos 6.2

bashrc tweaks for RHEL or CENTOS

Here are some excellent bashrc tweaks for RHEL or CENTOS:

## place in ~/.bashrc ## ## prevent embarassingly running command on whole server ## alias chown=’chown –preserve-root’ alias chmod=’chmod –preserve-root’ alias chgrp=’chgrp –preserve-root’ ## Interactive confirmation ## alias mv=’mv -i’ alias cp=’cp -i’ alias ln=’ln -i’ ## set defaults for disk usage and disk free . . . → Read More: bashrc tweaks for RHEL or CENTOS

One Liners

Linux and Bash One Liners Command Line Fu – Top One Liners Thu, 17 Feb 2011 11:13:19 +0000: Put a console clock in top right corner – All commands sorted by votes$ while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done & A nice way to use the console in full screen without forget the current time.
you can too add other infos like cpu and mem use.
View this command to comment, vote or add to favourites
View all commands by glaudiston

Diff your entire server config at ScriptRock.com

Fri, 23 Jul 2010 03:33:46 +0000: type partial command, kill this command, check something you forgot, yank the command, resume typing. – All commands sorted by votes$ <ctrl+u> […] <ctrl+y>
Example :
vim /etc/fstab
## damn
<ctrl+u>
sudo <ctrl+y>
## like a boss.
Example 2 :
sudo vim /root/bin/
##uh… autocomplete doesn’t work…
<ctrl+u>
sudo ls /root/bin
##ah! that’s the name of the file!
<ctrl+y> sudo vim /root/bin/ ##resume here! Thanks readline!
View this command to comment, vote or add to favourites
View all commands by adeverteuil

Diff your entire server config at ScriptRock.com

Wed, 21 Apr 2010 13:10:33 +0000: Get your external IP address – All commands sorted by votes$ curl ifconfig.me
curl ifconfig.me/ip -> IP Adress
curl ifconfig.me/host -> Remote Host
curl ifconfig.me/ua ->User Agent
curl ifconfig.me/port -> Port
thonks to http://ifconfig.me/
View this command to comment, vote or add to favourites
View all commands by aajjk

Diff your entire server config at ScriptRock.com

Fri, 31 Jul 2009 16:08:59 +0000: Query Wikipedia via console over DNS – All commands sorted by votes$ dig +short txt <keyword>.wp.dg.cx
Query Wikipedia by issuing a DNS query for a TXT record. The TXT record will also include a short URL to the complete corresponding Wikipedia entry.You can also write a little shell script like:
$ cat wikisole.sh

#!/bin/sh

dig +short txt ${1}.wp.dg.cx
and run it like
./wikisole.sh unix
were your first option ($1) will be used as search term.
View this command to comment, vote or add to favourites
View all commands by drizzt

Diff your entire server config at ScriptRock.com

Fri, 10 Apr 2009 12:22:34 +0000: Close shell keeping all subprocess running – All commands sorted by votes$ disown -a && exit

View this command to comment, vote or add to favourites
View all commands by prayer

Diff your entire server config at ScriptRock.com

Tue, 31 Mar 2009 10:29:20 +0000: Quick access to the ascii table. – All commands sorted by votes$ man ascii

View this command to comment, vote or add to favourites
View all commands by ntheother

Diff your entire server config at ScriptRock.com

Thu, 26 Mar 2009 22:59:48 +0000: Watch Star Wars via telnet – All commands sorted by votes$ telnet towel.blinkenlights.nl
Use Ctrl-] to stop it.
View this command to comment, vote or add to favourites
View all commands by Alioth

Diff your entire server config at ScriptRock.com

Fri, 20 Mar 2009 22:50:06 +0000: A very simple and useful stopwatch – All commands sorted by votes$ time read (ctrl-d to stop)
time read -sn1 (s:silent, n:number of characters. Press any character to stop)
View this command to comment, vote or add to favourites
View all commands by mrttlemonde

Diff your entire server config at ScriptRock.com

Fri, 20 Mar 2009 14:18:56 +0000: currently mounted filesystems in nice layout – All commands sorted by votes$ mount | column -t
Particularly useful if you’re mounting different drives, using the following command will allow you to see all the filesystems currently mounted on your computer and their respective specs with the added benefit of nice formatting.
View this command to comment, vote or add to favourites
View all commands by thechile

Diff your entire server config at ScriptRock.com

Fri, 20 Mar 2009 11:36:04 +0000: Place the argument of the most recent command on the shell – All commands sorted by votes$ ‘ALT+.’ or ‘<ESC> .’
When typing out long arguments, such as:
cp file.txt /var/www/wp-content/uploads/2009/03/
You can put that argument on your command line by holding down the ALT key and pressing the period ‘.’ or by pressing <ESC> then the period ‘.’. For example:
cd ‘ALT+.’
would put ‘/var/www/wp-content/uploads/2009/03/ as my argument. Keeping pressing ‘ALT+.’ to cycle through arguments of your commands starting from most recent to oldest. This can save a ton of typing.
View this command to comment, vote or add to favourites
View all commands by atoponce

Diff your entire server config at ScriptRock.com

Wed, 18 Mar 2009 17:38:49 +0000: Clear the terminal screen – All commands sorted by votes$ ctrl-l

View this command to comment, vote or add to favourites
View all commands by mrttlemonde

Diff your entire server config at ScriptRock.com

Wed, 11 Mar 2009 09:26:05 +0000: Rapidly invoke an editor to write a long, complex, or tricky command – All commands sorted by votes$ ctrl-x e
Next time you are using your shell, try typing ctrl-x e (that is holding control key press x and then e). The shell will take what you’ve written on the command line thus far and paste it into the editor specified by $EDITOR. Then you can edit at leisure using all the powerful macros and commands of vi, emacs, nano, or whatever.
View this command to comment, vote or add to favourites
View all commands by fool

Diff your entire server config at ScriptRock.com

Tue, 03 Mar 2009 23:21:36 +0000: SSH connection through host in the middle – All commands sorted by votes$ ssh -t reachable_host ssh unreachable_host
Unreachable_host is unavailable from local network, but it’s available from reachable_host’s network. This command creates a connection to unreachable_host through “hidden” connection to reachable_host.
View this command to comment, vote or add to favourites
View all commands by patko

Diff your entire server config at ScriptRock.com

Thu, 19 Feb 2009 14:33:46 +0000: Make ‘less’ behave like ‘tail -f’. – All commands sorted by votes$ less +F somelogfile
Using +F will put less in follow mode. This works similar to ‘tail -f’. To stop scrolling, use the interrupt. Then you’ll get the normal benefits of less (scroll, etc.).
Pressing SHIFT-F will resume the ‘tailling’.
View this command to comment, vote or add to favourites
View all commands by adamm9

Diff your entire server config at ScriptRock.com

Tue, 17 Feb 2009 22:53:07 +0000: Download an entire website – All commands sorted by votes$ wget –random-wait -r -p -e robots=off -U mozilla http://www.example.com
-p parameter tells wget to include all files, including images.
-e robots=off you don’t want wget to obey by the robots.txt file
-U mozilla as your browsers identity.
–random-wait to let wget chose a random number of seconds to wait, avoid get into black list.
Other Useful wget Parameters:
–limit-rate=20k limits the rate at which it downloads files.
-b continues wget after logging out.
-o $HOME/wget_log.txt logs the output
View this command to comment, vote or add to favourites
View all commands by starchox

Diff your entire server config at ScriptRock.com

Sun, 08 Feb 2009 10:10:00 +0000: output your microphone to a remote computer’s speaker – All commands sorted by votes$ dd if=/dev/dsp | ssh -c arcfour -C [email protected] dd of=/dev/dsp
This will output the sound from your microphone port to the ssh target computer’s speaker port. The sound quality is very bad, so you will hear a lot of hissing.
View this command to comment, vote or add to favourites
View all commands by morpheus

Diff your entire server config at ScriptRock.com

Fri, 06 Feb 2009 00:33:08 +0000: Mount a temporary ram partition – All commands sorted by votes$ mount -t tmpfs tmpfs /mnt -o size=1024m
Makes a partition in ram which is useful if you need a temporary working space as read/write access is fast.
Be aware that anything saved in this partition will be gone after your computer is turned off.
View this command to comment, vote or add to favourites
View all commands by ajrobinson

Diff your entire server config at ScriptRock.com

Thu, 05 Feb 2009 20:17:41 +0000: Mount folder/filesystem through SSH – All commands sorted by votes$ sshfs [email protected]:/path/to/folder /path/to/mount/point
Install SSHFS from http://fuse.sourceforge.net/sshfs.html
Will allow you to mount a folder security over a network.
View this command to comment, vote or add to favourites
View all commands by ihasn

Diff your entire server config at ScriptRock.com

Thu, 05 Feb 2009 18:33:23 +0000: Update twitter via curl – All commands sorted by votes$ curl -u user:pass -d status=”Tweeting from the shell” http://twitter.com/statuses/update.xml

View this command to comment, vote or add to favourites
View all commands by adamm9

Diff your entire server config at ScriptRock.com

Thu, 05 Feb 2009 11:57:43 +0000: Serve current directory tree at http://$HOSTNAME:8000/ – All commands sorted by votes$ python -m SimpleHTTPServer

View this command to comment, vote or add to favourites
View all commands by pixelbeat

Diff your entire server config at ScriptRock.com

Bash one Liners

Linux One Liners

ssh tee

Pipe the output of a command ran over ssh to the local terminal

# echo ‘********’;whoami;hostname;ssh [email protected] -c 3des “echo ‘********’ && hostname && whoami | tee /tmp/hostname.txt”;echo ‘********’ ******** host1 root ******** host2 root ********

Or a shorter version:

# ssh [email protected] -c 3des “hostname | tee /tmp/hostname.txt” host2 Pretty Print memory . . . → Read More: Linux One Liners

ssh keeps disconnecting

“ssh keeps disconnecting my session”. Here’s the fix!

Server Side Fix

As root modify /etc/ssh/sshd_config and add these lines

##Server will send “keep alive” messages every 4minute 58 seconds ClientAliveInterval 298 ##If there is no response after 4.1 hours close the connection ClientAliveCountMax 50

If you want to be able to ssh to other machines . . . → Read More: ssh keeps disconnecting