Git: Setting Up and Accessing a New Remote Respoitory

Using Backwater as the remote server, su to gitpriv and change into the repo directory.

$ sudo su - gitpriv
$ cd gitrepo

Here there are some top-level repos already, as well has some directories that contain like repos. These include “c-code” and “web.” If creating a repo to store a web app, change into the web directory and create an empty repo. Be sure it has a “.git” extension.

Here I am creating a repo to store the pydio app for LiM.

$ cd web
$ git init --bare --shared lim.pydio.git

Now that that is done, the empty repo must be copied to the system where work will be done. Change into the appropriate source directory and clone the repo.

git clone gitpriv@backwater.techmentor.com:gitrepo/web/lim.pydio.git

No populate it with the code and commit it.

$ rsync -av -e 'ssh -p 2222' motion18@share.learninginmotion.com:www/share/* .
$ git add -A
$ git commit -m "Version 5.2.3 after configuration"
$ git tag -a Live-5.2.3
$ git send
Posted in git, Journal | Leave a comment

Mavericks: Set SSH Port

Found the following script:

#!/bin/bash
#############################################
# AUTHOR: JONATHAN SCHWENN @JONSCHWENN      #
# MAC MINI VAULT - MAC MINI COLOCATION      #
# MACMINIVAULT.COM - @MACMINIVAULT          #
# VERSION 1.01 RELEASE DATE NOV 05 2013     #
# DESC:  CHANGES THE PORT SSH LISTENS ON    #
#############################################
#REQUIREMENTS:
#  OS X 10.8 or newer
#############################################
#CHECK FOR OS X 10.8+
if [[  $(sw_vers -productVersion | grep '10.[8-9]')  ]]
then
echo "THIS SCRIPT WILL CHANGE YOUR SSH PORT AND RESTART SSH."
echo "THE DEFAULT PORT FOR SSH IS 22, WE RECOMMEND A CUSTOM"
echo "PORT OVER 1000.  THIS SCRIPT CAN ALSO RETURN SSH BACK"
echo "TO 22, JUST ENTER "22" FOR THE PORT NUMBER."
echo "........."
echo "PLEASE ENTER A PORT NUMBER:"
while read port; do
	if [[ $port =~ ^[0-9]{2,5}$ ]]; then
		if [[ $port = 22 ]]; then
			sudo /usr/libexec/PlistBuddy -c "Set Sockets:Listeners:SockServiceName ssh" /System/Library/LaunchDaemons/ssh.plist 
echo "SYSTEM WILL NOW LISTEN ON DEFAULT PORT 22 FOR SSH"
		break 2		
		else
			sudo /usr/libexec/PlistBuddy -c "Set Sockets:Listeners:SockServiceName $port" /System/Library/LaunchDaemons/ssh.plist 
echo "SYSTEM WILL NOW LISTEN ON PORT $port FOR SSH"
		break 2
		fi
	else
echo "INVALID PORT: MUST BE NUMERIC! (2 to 5 digits)"
	fi
done
#TURN OFF AND TURN BACK ON REMOTE LOGIN
echo "yes" | sudo systemsetup -setremotelogin off > /dev/null 2>&1
sleep 5
sudo systemsetup -setremotelogin on > /dev/null 2>&1
else
echo "ERROR: YOU ARE NOT RUNNING OS X 10.8 OR NEWER"
exit 1
fi
Posted in System Configuration | Tagged , , | Comments Off on Mavericks: Set SSH Port

ColdStone Theme: Added Hardcoded Video Iframe Just Above Recent Posts

Added the following to includes/default.php:

<!-- SUB POST DIVISIONS -->
<div class="subpost_wrap2">
    <div class="subpost_wrap">
        <div class="subpost_left">
<!-- 2014-06-02 Added Video to top of recent posts -->
<div align="center">
<iframe style="border-width:5px; border-style:solid; border-color:#615E56;" width="450" height="253" src="//www.youtube.com/embed/4zEi8p1ZwNI" allowfullscreen></iframe>
</div>
<!-- End of 2014-06-02 video add -->
            <?php while (have_posts()) : the_post(); ?>
...
Posted in Wordpress | Comments Off on ColdStone Theme: Added Hardcoded Video Iframe Just Above Recent Posts

ColdStone Theme: Using Pages Instead of Posts for Featured Image

Hi,
please go to featured.php

save the file just in case;

there, find: $coldstone_featured_number=

make this equal with the numbers of pages you will use for the slider, like:

$coldstone_featured_number=3;

find:

$my_query = new WP_Query

before this add:

$args = array(
‘post_type’ => ‘page’,
‘post__in’ => array(2,78,55)
);

where 2,78,55 are 3 id’s of the pages you want to show in the slider. You need to insert here the actual id’s of the pages you want to include in the slider;

then replace the line:
$my_query = new WP_Query(………

with:

$my_query = new WP_Query($args);

and it should work

From: https://www.elegantthemes.com/forum/viewtopic.php?f=31&t=146758

Posted in Wordpress | Comments Off on ColdStone Theme: Using Pages Instead of Posts for Featured Image

GPS Data Conversion

# cat * | grep ^T > Total.txt
# cat Total.txt | sed 's/T  //' > Tstriped.txt
# grep -v '^Tr' Tstriped.txt > Total.txt
# cat Total.txt | sed -e 's/ 1999//' -e 's/ Sun//' -e 's/ Mon//' -e 's/ Tue//' -e 's/ Wed//' -e 's/ Thu//' -e 's/ Fri//' -e 's/ Sat//' > Finished.txt
# cat Finished.txt | sed -e 's/^\(.\{12\}\)/\1,/' -e 's/^\(.\{26\}\)/\1,/' -e 's/ ,/,/g' > Final.csv
  1. Extract Only Track Info
  2. Remove Track Label
  3. Remove Beginning and End lines
  4. Get rid of Days and Year
  5. Add Commas
Posted in Journal | Comments Off on GPS Data Conversion

Ubuntu: Installing kompoZer on 13.10

Install the dependencies:

sudo apt-get install libatk1.0-0 libc6 libcairo2 libfontconfig1 libfreetype6 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk2.0-0 libidl0 libnspr4 libnss3 libpango1.0-0 libpng12-0 libstdc++6 libx11-6 libxft2 libxinerama1 libxrender1 libxt6 zlib1g

Download the packages:

wget -c https://launchpad.net/ubuntu/+archive/primary/+files/kompozer-data_0.8~b3.dfsg.1-0.1ubuntu2_all.deb
wget -c https://launchpad.net/ubuntu/+archive/primary/+files/kompozer-dev_0.8~b3.dfsg.1-0.1ubuntu2_all.deb
wget -c https://launchpad.net/ubuntu/+archive/primary/+files/kompozer_0.8~b3.dfsg.1-0.1ubuntu2_amd64.deb

Install the packages and fix the broken dependencies, if any:

sudo dpkg -i kompozer*.deb
sudo apt-get install -f
Posted in Journal, Web Geeking | Tagged , , , | Comments Off on Ubuntu: Installing kompoZer on 13.10

Thumb Drive Backups…

Bought a 6-pack of 4GB USB thumb drives for various backups. I installed them on liminf01, liminf03, and kfserver01. Used the following commands to format and mount them, since CentOS 5.10 did not automatically mount them. I originally went with the default FAT32 filesystems, but rsync filed to create symlinks, surprise!

Step 1: Identify the proper device:

$ ls -al /dev/sd*
brw-r----- 1 root disk 8,  0 Apr  9 17:59 /dev/sda
brw-r----- 1 root disk 8,  1 Apr  9 17:59 /dev/sda1
brw-r----- 1 root disk 8,  2 Apr  9 18:00 /dev/sda2
brw-r----- 1 root disk 8,  3 Apr  9 17:59 /dev/sda3
brw-r----- 1 root disk 8, 16 Apr 16 09:00 /dev/sdb

Step 2: Delete the existing FAT partition and create a new partition.

$ sudo /sbin/fdisk /dev/sdb

If prompted, switch off DOS-compatible mode and change units to sectors.

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): c
DOS Compatibility flag is not set

Command (m for help): u
Changing display/entry units to sectors

Delete the existing partition.

Command (m for help): d
Selected partition 1

Create the new partition, using the defaults to use the whole disk.

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First sector (2048-7821279, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-7821279, default 7821279): 
Using default value 7821279

List the partition table to confirm the changes.

Command (m for help): p

Disk /dev/sdf1: 4004 MB, 4004495360 bytes
124 heads, 62 sectors/track, 1017 cylinders, total 7821280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

     Device Boot      Start         End      Blocks   Id  System
/dev/sdf1p1            2048     7821279     3909616   83  Linux

Write (save) the new partition table.

Command (m for help): w
The partition table has been altered!

Step 3: Format the new partition

I used ext3 because CentOS 5.10 did not support ext4. I also labeled the partition as “backup.”

$ mkfs.ext3 -L backup /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=backup
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
244800 inodes, 977660 blocks
48883 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1002438656
30 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

On netmon01, the new partition was automatically mounted when I removed and inserted the drive. On liminf01, liminf03, and kfserver01 that was not the case.

I created the directory that I wanted it mounted on.

$ sudo mkdir /media/backup

Then I added the partition to /etc/fstab.

/dev/VolGroup00/LogVol00 /                      ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                   swap    defaults        0 0
/dev/sdb1               /media/backup           ext3    defaults        1 3

Finally I mounted it.

$ sudo mount -a
$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      447G  9.2G  414G   3% /
/dev/sda1              99M   38M   57M  40% /boot
tmpfs                 2.9G     0  2.9G   0% /dev/shm
/dev/sdc1             3.7G  2.5G  1.1G  70% /media/backup
Posted in Journal, LiM, System Configuration | Comments Off on Thumb Drive Backups…

Git: Revert from Uncommitted Changes

# Revert changes to modified files.
git reset --hard

# Remove all untracked files and directories.
git clean -fd

If you want to revert the changes only in current working directory, use

git checkout -- .
Posted in git | Tagged | Comments Off on Git: Revert from Uncommitted Changes

Install Latest Git on CentOS

Setup RPMForge Repository

$ wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
$ rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
$ rpm -K rpmforge-release-0.5.3-1.el6.rf.*.rpm
$ sudo rpm -i rpmforge-release-0.5.3-1.el6.rf.*.rpm

Disable CentOS Base Repository and Enable RPMForge Extras

$ cd /etc/yum.repos.d/
$ sudo vi CentOS-Base.repo

Add enabled = 0

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
enabled = 0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
$ sudo vi rpmforge.repo

Change enabled = to 1

[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/extras
mirrorlist = http://mirrorlist.repoforge.org/el6/mirrors-rpmforge-extras
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

Remove Git, update, reinstall get, & verify version.

$ sudo yum clean all
$ sudo yum remove git
$ sudo yum update
$ sudo yum install git
$ git --version
git version 1.7.12.4
Posted in git, System Configuration | Tagged , , | Comments Off on Install Latest Git on CentOS

Git: Upgrading osCommerce

Change to the working directory and checkout the dev branch.

$ cd ~/source/web-store
$ git checkout dev

Download the appropriate update file from http://www.oscommerce.com/Products and unzip it.

$ cd ~/Downloads/osCommerce
$ unzip oscommerce-2.3.3.2-to-2.3.3.3.zip

Rename admin to lim_admin and copy the files over to the working directory.

$ cd oscommerce-2.3.3.2-to-2.3.3.3
$ catalog/
$ mv admin/ lim_admin
$ cp -R * ~/source/web-store/

Change back to the working directory and update the git repo.

$ cd ~/source/web-store
$ git add -A
$ git commit -m "Updating to version 2.3.3.3"

Create branch for the release.

$ git checkout -b release-2.3.3.3

FTP the new/updated files to the webserver and test. Make any needed changes to the release branch. Once working and happy, merge changes back into “master.”

$ git checkout master
$ git merge --no-ff release-2.3.3.3
$ git tag -a 2.3.3.3
$ git send

If there were changes to the release branch, merger them back into the dev branch.

$ git checkout dev
$ git merge --no-ff release-2.3.3.3
$ git send

…and all finished.

Posted in Journal, LiM | Tagged , | Comments Off on Git: Upgrading osCommerce