tag:blogger.com,1999:blog-70097449759321723812024-03-12T23:04:22.773-04:00Hwarf NugenAnonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-7009744975932172381.post-71248714839575112802015-03-21T07:05:00.000-04:002018-06-29T08:00:31.902-04:00DNS Caching and Forwarding with UnboundThis howto shows the steps needed to configure unbound for DNS caching and forwarding from the 192.168.1.0/24 network. It assumes the server’s IP address is 192.168.1.22 and is running RHEL/CentOS 7.<br />
<h3>
Installation</h3>
<pre class="code">[root@rhce-server ~]# yum install unbound
</pre>
<h3>
Configure Systemd</h3>
<pre class="code">[root@rhce-server ~]# systemctl enable unbound
ln -s '/usr/lib/systemd/system/unbound.service' '/etc/systemd/system/multi-user.target.wants/unbound.service'
[root@rhce-server ~]# ^enable^start
systemctl start unbound
</pre>
<h3>
Configure the Firewall</h3>
<pre class="code">[root@rhce-server ~]# firewall-cmd --add-service=dns
success
[root@rhce-server ~]# firewall-cmd --add-service=dns --permanent
success
</pre>
<h3>
Configure Unbound</h3>
Unbound’s configuration is stored in <strong>/etc/unbound/unbound.conf</strong>.<br />
By default unbound only listens on the loopback interface. Specify which interface you would like to use.<br />
<pre class="code">interface: 192.168.1.22
</pre>
Allow queries from 192.168.1.0/24.<br />
<pre class="code">access-control: 192.168.1.0/24 allow
</pre>
Disable DNSSEC.<br />
<pre class="code">domain-insecure: *
</pre>
Forward uncached requests to <a href="http://www.opendns.com/">OpenDNS</a>.<br />
<pre class="code">forward-zone:
name: *
forward-addr: 208.67.222.222
forward-addr: 208.67.220.220
</pre>
<h3>
Check Your Configuration</h3>
<pre class="code">[root@rhce-server ~]# unbound-checkconf
unbound-checkconf: no errors in /etc/unbound/unbound.conf
</pre>
<h3>
Restart the Unbound Service</h3>
<pre class="code">[root@rhce-server ~]# systemctl restart unbound
</pre>
<h3>
Verify it is Working</h3>
Test from a different system on the network.<br />
<pre class="code">mooose:~ jglemza$ dig fark.com A @192.168.1.22
; <<>> DiG 9.8.3-P1 <<>> fark.com A @192.168.1.22
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60299
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;fark.com. IN A
;; ANSWER SECTION:
fark.com. 43200 IN A 64.191.171.200
;; Query time: 234 msec
;; SERVER: 192.168.1.22#53(192.168.1.22)
;; WHEN: Sat Mar 21 13:16:54 2015
;; MSG SIZE rcvd: 42
</pre>
Verify the record is now in unbound’s cache.<br />
<pre class="code">[root@rhce-server ~]# unbound-control dump_cache|grep fark.com
ns2.fark.com. 43197 IN A 23.253.56.58
fark.com. 43197 IN A 64.191.171.200
ns1.fark.com. 43197 IN A 64.191.171.194
fark.com. 43197 IN NS ns1.fark.com.
fark.com. 43197 IN NS ns2.fark.com.
...
</pre>
Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com1tag:blogger.com,1999:blog-7009744975932172381.post-69210847799822501762015-03-21T06:30:00.000-04:002018-06-29T08:00:57.106-04:00RHEL / CentOS 7 Network TeamingBelow is an example on how to configure network teaming on RHEL/CentOS 7. It is assumed that you have at least two interface cards.<br />
<h3>
Show Current Network Interfaces</h3>
<pre class="code">[root@rhce-server ~]$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
link/ether 00:0c:29:69:bf:87 brd ff:ff:ff:ff:ff:ff
3: eno33554984: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
link/ether 00:0c:29:69:bf:91 brd ff:ff:ff:ff:ff:ff
</pre>
The two devices I will be teaming are eno33554984 and eno16777736.<br />
<h3>
Create the Team Interface</h3>
<pre class="code">[root@rhce-server ~]$ nmcli connection add type team con-name team0 ifname team0 config '{"runner": {"name": "activebackup"}}'
</pre>
This will configure the interface for activebackup. Other runners include broadcast, roundrobin, loadbalance, and lacp.<br />
<h3>
Configure team0’s IP Address</h3>
<pre class="code">[root@rhce-server ~]# nmcli connection modify team0 ipv4.addresses 192.168.1.22/24
[root@rhce-server ~]# nmcli connection modify team0 ipv4.method manual
</pre>
You can also configure IPv6 address by setting the ipv6.addresses field.<br />
<h3>
Configure the Team Slaves</h3>
<pre class="code">[root@rhce-server ~]# nmcli connection add type team-slave con-name team0-slave1 ifname eno33554984 master team0
Connection 'team0-slave1' (4167ea50-7d3a-4024-98e1-3058a4dcf0fa) successfully added.
[root@rhce-server ~]# nmcli connection add type team-slave con-name team0-slave2 ifname eno16777736 master team0
Connection 'team0-slave2' (d5ed65d1-16a7-4bc7-8c4d-78e17a1ed8b3) successfully added.
</pre>
<h3>
Check the Connection</h3>
<pre class="code">[root@rhce-server ~]# teamdctl team0 state
setup:
runner: activebackup
ports:
eno16777736
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
eno33554984
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
runner:
active port: eno16777736
[root@rhce-server ~]# ping -I team0 192.168.1.1
PING 192.168.1.1 (192.168.1.1) from 192.168.1.24 team0: 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.38 ms
...
</pre>
<h3>
Test Failover</h3>
<pre class="code">[root@rhce-server ~]# nmcli device disconnect eno16777736
[root@rhce-server ~]# teamdctl team0 state
setup:
runner: activebackup
ports:
eno33554984
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
runner:
active port: eno33554984
</pre>
Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com0tag:blogger.com,1999:blog-7009744975932172381.post-40695216130394658262015-03-21T05:30:00.000-04:002018-06-29T08:30:44.966-04:00Configuring Postfix as a Local Network RelayThis howto assumes that the relay server’s IP address is 192.168.1.22 and is running RHEL/CentOS 7. Only mail from the 192.168.1.0/24 network should be accepted and relayed.<br />
<h3>
Install Postfix</h3>
<pre class="code">[root@rhce-server ~]# yum install postfix
</pre>
<h3>
Configure Systemd</h3>
<pre class="code">[root@rhce-server ~]# systemctl enable postfix
[root@rhce-server ~]# ^enable^start
</pre>
<h3>
Configure the Firewall</h3>
<pre class="code">[root@rhce-server ~]# firewall-cmd --add-service=smtp
success
[root@rhce-server ~]# firewall-cmd --add-service=smtp --permanent
success
</pre>
<h3>
Configure Postfix</h3>
Postfix’s main configuration file is located at <strong>/etc/postfix/main.cf</strong>.<br />
Configure Postfix to listen on the correct interface.<br />
<pre class="code">inet_interfaces = all
</pre>
Configure the trusted network.<br />
<pre class="code">mynetworks = 192.168.1.0/24
</pre>
Configure the list of domains that this Postfix service should consider itself the final destination for. In my case the server is named rhce-server.<br />
<pre class="code">mydestination = rhce-server, localhost.localdomain, localhost
</pre>
Configure all mail not destined for this server to be relayed to another SMTP server. I am using Time Warner Cable’s SMTP server for Northeast Ohio. The brackets tell Postfix to turn off MX lookups.<br />
<pre class="code">relayhost = [smtp-server.neo.rr.com]
</pre>
<h3>
Restart Postfix</h3>
<pre class="code">[root@rhce-server postfix]# systemctl restart postfix
</pre>
<h3>
Send a Test Email</h3>
<pre class="code">[root@rhce-server postfix]# mail -s "rhce-server test" josh@example.com
testing our null postfix configuration
.
EOT
</pre>
With any luck we should be all set. You can verify the mail was successfully relayed in <strong>/var/log/maillog</strong>.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com1tag:blogger.com,1999:blog-7009744975932172381.post-69888884333280685012015-02-10T08:09:00.000-05:002018-06-29T08:10:23.429-04:00Running pfSense in Proxmox/KVM with PCI PassthroughBelow is how I was able to get <a href="http://pfsense.org/">pfSense</a> 2.2 running under <a href="https://www.proxmox.com/">Proxmox</a> 3.3 with PCI passthrough for two Intel NICs. My first attempts were trying to utilize VirtIO and e1000 network devices but the performance was abysmal. With PCI passthrough I was able to achieve native throughput in my environment.<br />
I am assuming that you have Proxmox running and a pfSense virtual machine already created.<br />
<h4>
Configure the Proxmox Test Repository</h4>
The first thing we need to do is enable the Proxmox test repository so that we may install the 3.10 kernel.<br />
<pre class="code">echo 'deb http://download.proxmox.com/debian wheezy pvetest' >> /etc/apt/sources.list
</pre>
<h4>
Install the 3.10 Kernel</h4>
<pre class="code">apt-get install pve-kernel-3.10.0-6
</pre>
<h4>
Edit Grub Configuration</h4>
We need to pass a kernel flag to enable IOMMU. In my case I am using an AMD processor and added amd_iommu=on to the following line in /etc/default/grub. If you are using an Intel processor you would add intel_iommu=on.<br />
<pre class="code">GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"
</pre>
Update the Grub configuration<br />
<pre class="code">update-grub
</pre>
Reboot the server. By default the 3.10 kernel should be selected.<br />
<h4>
Identify Your NICs</h4>
Identify the PCI devices you want to passthrough to your virtual machine.<br />
<pre class="code">lspci
</pre>
In my case I was looking for my Intel NICs.<br />
<pre class="code">lspci | grep Intel
03:00.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet Controller (rev 05)
04:00.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet Controller (rev 05)
</pre>
You will need to note their addresses.<br />
<h4>
Edit the Virtual Machine Configuration</h4>
Below is an example of my working configuration. You can find these configurations in /etc/pve/qemu-server/. The file you are looking for will correspond with the virtual machine ID. In my case 100.conf.<br />
<pre class="code">boot: cdn
bootdisk: ide0
cores: 2
cpu: qemu32
hostpci0: 03:00.0,pcie=1,driver=vfio
hostpci1: 04:00.0,pcie=1,driver=vfio
ide0: local:100/vm-100-disk-1.qcow2,format=qcow2,size=16G
ide2: local:iso/pfSense-LiveCD-2.2-RELEASE-i386.iso,media=cdrom,size=206916K
machine: pc-q35-2.0
memory: 1024
name: pfSense
onboot: 1
ostype: other
smbios1: uuid=0f590e3e-88a0-4084-8a6f-f5a2380a01fa
sockets: 2
tablet: 0
</pre>
Notice that I added the hostpci0, hostpci1, and machine options. The hostpciX options identify which PCI devices we want to passthrough. As we found above I was looking for my NICs at 03:00.0 and 04:00.0. The machine must be set to pc-q35-2.0 for PCI passthrough to work with FreeBSD from my experience.<br />
<h4>
Conclusion</h4>
With those options set you should be able to boot your pfSense virtual machine and see your PCI devices natively.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com2tag:blogger.com,1999:blog-7009744975932172381.post-36627269665598356642015-01-07T08:13:00.000-05:002018-06-29T08:14:38.080-04:00Using Apache as a Reverse Proxy with SiteMinder for AuthenticationWhen using Apache as a reverse proxy to pass authentication to another application from SiteMinder you may need to send the header variable to your application. By default Apache is not passing these variables on and you need to set them up for your proxy.<br />
<br />
<pre class="code">RequestHeader set REMOTE_USER %{HTTP:UID}s
</pre>
<br />
Above is an example of the variable UID being returned by SiteMinder and being assigned to the variable REMOTE_USER that will be provided to the end application.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com0tag:blogger.com,1999:blog-7009744975932172381.post-13894296423001482892014-02-19T08:17:00.000-05:002018-06-29T08:18:17.750-04:00Detect a New Disk and Grow a Filesystem in Linux without RebootingIf you have ever wanted to add a new hard disk to a Linux VMware guest without rebooting here is the solution. After running this command you should be able to use the new disk as you please. This is really useful for growing an LVM filesystem on the fly.<br />
Run this command after adding the new disk to you VMware configuration. This will allow your Linux guest to detect the new disk and assign it as a device.<br />
<pre class="code">ls /sys/class/scsi_host/ | while read host ; do echo "- - -" > /sys/class/scsi_host/$host/scan ; done
</pre>
Once you have ran this command you can grow the LVM filesystem as usual. (Where X is the new device added.)<br />
<pre class="code"># Create a new partition on the new disk. Assign it the type of Linux LVM, 8e.
fdisk /dev/sdX
# Create the new physical volume.
pvcreate /dev/sdX1
# Extend the volume group of your choice.
vgextend /dev/VolumeGroupName /dev/sdX1
# Confirm the new physical extents are available and take note of the number.
vgdisplay
# Extend a logical volume where 1234 is the number of PEs you would like to add.
lvextend -l +1234 /dev/VolumeGroupName/LogVolName
# Resize the EXT filesystem.
resize2fs /dev/VolumeGroupName/LogVolName
# Confirm the new space is available.
df -h
</pre>
Once complete you should have extra space on your Linux guest.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com0tag:blogger.com,1999:blog-7009744975932172381.post-63502417677392615582014-02-16T08:20:00.000-05:002018-06-29T08:20:30.641-04:00Recursive Directory/File PermissionsI’m constantly needing to recursively set different permissions on files and directories to make suPHP happy. I’m posting this here for easy reference.<br />
<pre class="code"># Directories
find . -type d -exec chmod 755 {} +
# Files
find . -type f -exec chmod 644 {} +
</pre>
Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com0tag:blogger.com,1999:blog-7009744975932172381.post-90210301991992507172012-08-03T22:05:00.000-04:002012-08-03T22:23:39.266-04:00Why I Chose Unraid for my Home Storage Solution<h1>
<a href="http://lime-technology.com/products/registration-keys">Unraid</a></h1>
<h2>
Description</h2>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBJdme_P8-I4USNlROIz0thTiGp_id6qRArc4Y4yIfOAB1mZy18N9djz_ZADiIrazs-fGtkGXQ9JU_WJ9huTC-U8OESLDW8SQnytFsTWMcC7JnAh8I4jDJQcEeYjHfu29PNrAnclX2bn7H/s1600/unraid.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBJdme_P8-I4USNlROIz0thTiGp_id6qRArc4Y4yIfOAB1mZy18N9djz_ZADiIrazs-fGtkGXQ9JU_WJ9huTC-U8OESLDW8SQnytFsTWMcC7JnAh8I4jDJQcEeYjHfu29PNrAnclX2bn7H/s1600/unraid.png" /></a></div>
Unraid is a Slackware Linux based operating system that provides an
easy way to create network attached redundant storage. It's best suited for archival
purposes. It allows for the loss of one disk without losing data.<br />
<br />
Unraid has three different <a href="http://lime-technology.com/products/registration-keys">licenses</a> you can use,
Basic (free), Plus ($69), and Pro ($119). Look at the license page for
a description on how they differ.<br />
<br /></div>
<h2>
Advantages</h2>
<ul>
<li>Runs off of a USB flash drive. You don't lose a SATA port or disk
for the operating system.</li>
<li>Mix and match hard drives and sizes. You can put drives of any size
in the array. You only lose the largest disk in the array for parity.
(Similar to a Drobo)</li>
<li>Web interface. A simple web interface lets you configure everything.</li>
<li>Supports various protocols including SMB, AFP, and NFS.</li>
<li>No vendor lock-in. Although you're using the proprietary Unraid
system, all data is stored on the disks in the ReiserFS filesystem</li>
<li>Since it's using ReiserFS, if you lose more than one disk at a time
you'll be able to get data off the rest of the disks in the broken
array.</li>
<li>Use your own hardware. I built a little server with an Atom
processor for less than the price of the cheapest Drobo.</li>
<li>Set it and forget it. I've had my system running for almost two years</li>
<li>Stable. I set mine up and have basically forgotten about it. It just
works and has been since May 2011 when I configured it.</li>
<li>Spins down drives when not in use, unlike RAID-5.</li>
<li>Support and community. There's a very active <a href="http://lime-technology.com/forum/index.php">forum</a> and <a href="http://lime-technology.com/wiki/index.php/UnRAID_Wiki">wiki</a> to help you
with any issues, add additional functionality, and much more.</li>
</ul>
<h2>
Disadvantages</h2>
<ul>
<li>Price could be. I purchased the $70 license. If you only have 3
disks and don't require some of the extra features, there is a free
version.</li>
<li>Write speeds. If you have the need to push stuff to the server at
more than 30MB/sec, this may not be the best choice. If you're just
archiving stuff, it really is not an issue. You can also speed the
writes up with a cache drive.</li>
</ul>
<h2>
Why I Chose Unraid</h2>
Throughout my history of having redundant storage at home I've had two
previous setups that really failed me.<br />
<h3>
<a href="http://tldp.org/HOWTO/Software-RAID-HOWTO.html">Linux Software RAID-5</a></h3>
Linux software RAID is great, but I had two drives fail at once. I
lost everything. With Unraid I would've been able to recover some of
the data on the drives that had not failed. You also cannot mix and
match drive sizes and the disks never spin down.<br />
<h3>
<a href="http://www.drobo.com/">Drobo</a></h3>
I had the second generation Firewire 800 Drobo. Transfer speeds were
horrible. It still needed a computer running to serve data. I
accidentally plugged the wrong power supply into it and it stopped
working. I was now stuck buying another expensive Drobo to get my data
or coming up with another solution. That is when I found Unraid.<br />
<br />
The Drobo is actually a really nice device. The newer ones are
supposed to be a lot faster and some even have sharing capabilities.
It's just too expensive and they've got you with vendor lock-in.<br />
<h2>
Links</h2>
If I haven't sold it to you yet, here's a few links to learn more about Unraid.<br />
<ul>
<li><a href="http://www.mediasmartserver.net/2011/05/18/guide-unraid-server-part-1-the-journey-to-unraid/">Guide: Unraid Server</a></li>
<li><a href="http://en.wikipedia.org/wiki/Non-standard_RAID_levels#UnRAID">Non-standard RAID Levels</a></li>
<li><a href="http://unraid.me/">Unraid Me: How to build your own Unraid box</a></li>
</ul>Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com1tag:blogger.com,1999:blog-7009744975932172381.post-26603876599830487672012-08-01T10:48:00.002-04:002012-08-01T10:55:14.755-04:00MySQL: Change Collation on an Existing Table<p>I recently ran across an issue where a table's collation was set to latin1_swedish_ci and it really should have been utf8_unicode_ci. Just changing the collation didn't seem to be doing the trick because some characters were still messed up. That's when I realized you need to convert the current character set to UTF8. After doing this everything worked as expected.</p>
<pre class="brush: sql; gutter: false;">ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci</pre>Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com1tag:blogger.com,1999:blog-7009744975932172381.post-19454345710376767372011-08-24T17:47:00.000-04:002012-07-31T10:24:21.839-04:00Configure PhpStorm to Auto-complete CakePHP Models, Views, and ControllersAfter playing around a bit today I finally figured out how to get PhpStorm to auto-complete methods for models and controllers. Here's what you need to do.<br />
<br />
<h3>Removing Multiple Definitions</h3>
<br />
First, let's tackle the multiple definitions problem that we see below.<br />
<br />
<div style="text-align: center;">
</div>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQUDI7-zZ7y5kE2M9t0Iu1p1OKN34Is2Z2fAU8oN24ixBrmjzgAZrvKlbTxOstWvOlBDZHgefW3Nki9taytjVRrU18rP0KkJW2A_W6bGzXgMzF7MHKQ_H8LScS2IAIh6NnU4NlV9Yc-mCS/s1600/multiple_definitions1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Multiple Definitions" border="0" height="85" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQUDI7-zZ7y5kE2M9t0Iu1p1OKN34Is2Z2fAU8oN24ixBrmjzgAZrvKlbTxOstWvOlBDZHgefW3Nki9taytjVRrU18rP0KkJW2A_W6bGzXgMzF7MHKQ_H8LScS2IAIh6NnU4NlV9Yc-mCS/s320/multiple_definitions1.png" title="Multiple Definitions" width="320" /></a></div>
<br /></div>
<br />
There are multiple places defining AppController. We need to remove the ones that are included in the following locations from our 'Directories' in the project's settings.<br />
<br />
The two locations are:<br />
<ul>
<li>$CAKEHOME/cake/console</li>
<li>$CAKEHOME/cake/tests</li>
</ul>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiK_Wgu36ikTEVluDbClb0jonWrcbybiEDJ-vpG4IxiFJTsKXErEvhzjY7P18gMgMohTOx9GUPCiHK2nvXSuZEN4PL-LpcpY9XeZ35xv0_zgDAgKzwwaGPNzSIplXAQ2tTlgBMq4zTk_nL/s1600/Screen-Shot-2011-08-24-at-10.07.17-PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Exclude Directories" border="0" height="134" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiK_Wgu36ikTEVluDbClb0jonWrcbybiEDJ-vpG4IxiFJTsKXErEvhzjY7P18gMgMohTOx9GUPCiHK2nvXSuZEN4PL-LpcpY9XeZ35xv0_zgDAgKzwwaGPNzSIplXAQ2tTlgBMq4zTk_nL/s320/Screen-Shot-2011-08-24-at-10.07.17-PM.png" title="Exclude Directories" width="320" /></a></div>
<br /></div>
<br />
Next we need to mark the following file as plain text.<br />
<ul>
<li>$CAKEHOME/cake/libs/controllers/app_controller.php</li>
</ul>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEq9XXpGk_MCNeY7Sf6E-MijNmtvr_MCehMHN0QV_j_xTyrL83zj_1qFJwJwsuzLRIqlPgbKmm9OQNJQS9F8Ed-OIczWHE58O59aCU5yqMnMio72-9emqRSbsT0DLII1YLuyl3Q7tOoU1-/s1600/multiple_definitions2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Mark as Plain Text" border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEq9XXpGk_MCNeY7Sf6E-MijNmtvr_MCehMHN0QV_j_xTyrL83zj_1qFJwJwsuzLRIqlPgbKmm9OQNJQS9F8Ed-OIczWHE58O59aCU5yqMnMio72-9emqRSbsT0DLII1YLuyl3Q7tOoU1-/s320/multiple_definitions2.png" title="Mark as Plain Text" width="286" /></a></div>
<br /></div>
<br />
You should now see that PhpStorm is no longer complaining about multiple definitions. If it is you may want to check your plugins/components to see if they're mucking it up. If they are, just mark the file with the definition as plain text.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixab0PGEXcoECnRdR-4B2-ddC0bRVGCUgrUBbfzMkHM5pl4DzkyDm6DVFngrLyJ18ZK4mDL-87CMGgS1xhTio8gJovmWOU3gH69y3nSCwaPw3HnA_XZdca-egkQbOyZUIlLojanBSkv7Hv/s1600/Screen-Shot-2011-08-24-at-10.18.36-PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Multiple Definitions Resolved" border="0" height="116" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixab0PGEXcoECnRdR-4B2-ddC0bRVGCUgrUBbfzMkHM5pl4DzkyDm6DVFngrLyJ18ZK4mDL-87CMGgS1xhTio8gJovmWOU3gH69y3nSCwaPw3HnA_XZdca-egkQbOyZUIlLojanBSkv7Hv/s320/Screen-Shot-2011-08-24-at-10.18.36-PM.png" title="Multiple Definitions Resolved" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<br />
<div style="text-align: left;">
Auto-completion should now work for the controller. However, it's still not working correctly on our model.</div>
<br />
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmoDRil0JKu1kAc12PcvXa9Y3l48Wv1ZaGRlrYD0v3SM0_zvBChlh8JiAjSRI5bqKE2zMiKeuroWyc6Gi-fAMe3FVOm2mgMt_7NGlCr8zWekPMiei38ivtbhRJ7iGR0wyeMtcgSe5Meevn/s1600/Screen-Shot-2011-08-24-at-10.24.40-PM.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Autocomplete works, but not on the model." border="0" height="72" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmoDRil0JKu1kAc12PcvXa9Y3l48Wv1ZaGRlrYD0v3SM0_zvBChlh8JiAjSRI5bqKE2zMiKeuroWyc6Gi-fAMe3FVOm2mgMt_7NGlCr8zWekPMiei38ivtbhRJ7iGR0wyeMtcgSe5Meevn/s320/Screen-Shot-2011-08-24-at-10.24.40-PM.jpg" title="Autocomplete works, but not on the model." width="320" /></a></div>
<br /></div>
<br />
<h3 style="text-align: left;">Adding the Model</h3>
<br />
<div style="text-align: left;">
To fix the model we need to add a magic property to the class.</div>
<br />
<div style="text-align: left;">
<pre class="brush: php; gutter: false;"> /**
*@property ModelName $ModelName
*/
</pre>
</div>
<br />
<div style="text-align: left;">
Here's an example from the controller we've been working in.</div>
<br />
<div style="text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5E2UyhN_1MeeoxIfY-ES0ecngGe8m-HUpKncSqPnnngWTis2u7B-XiHpyZQpP-m_aNh-hMRI0Ue0zdCuug-QfGRhC3ZEcHCd5wVTHxCgyENMUKmsktX_L38Pkd2EhCYuriKLu7i1EOHaO/s1600/Screen-Shot-2011-08-24-at-10.31.34-PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="@property ModelName $ModelName" border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5E2UyhN_1MeeoxIfY-ES0ecngGe8m-HUpKncSqPnnngWTis2u7B-XiHpyZQpP-m_aNh-hMRI0Ue0zdCuug-QfGRhC3ZEcHCd5wVTHxCgyENMUKmsktX_L38Pkd2EhCYuriKLu7i1EOHaO/s320/Screen-Shot-2011-08-24-at-10.31.34-PM.png" title="@property ModelName $ModelName" width="320" /></a></div>
<div style="text-align: center;">
<br /></div>
<br />
We can now auto-complete on our models in the controller.<br />
<br />
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhONTOEkhcr0Fn431EV1xLVwkopCiTgfttUYkIGbo-sOJDV-6LwUrnjQ8__5Jde4xEYGbOGHJehcdHsrR-2H8T7VJ_RN4RsS3E_PTtK3qzgQPZa6_q81EHaotnXsgWbHjdsWWMRMgAlmFnE/s1600/Screen-Shot-2011-08-24-at-10.32.56-PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Auto-complete on the model." border="0" height="90" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhONTOEkhcr0Fn431EV1xLVwkopCiTgfttUYkIGbo-sOJDV-6LwUrnjQ8__5Jde4xEYGbOGHJehcdHsrR-2H8T7VJ_RN4RsS3E_PTtK3qzgQPZa6_q81EHaotnXsgWbHjdsWWMRMgAlmFnE/s320/Screen-Shot-2011-08-24-at-10.32.56-PM.png" title="Auto-complete on the model." width="320" /></a></div>
<br /></div>
<br />
<h3>
Defining Model Relationships</h3>
<br />
Lastly, we need to add magic properties to our models to define its relationships with other models. Basically, for each "belongs to" relationship defined in the model's file you need to add the magic property comment.<br />
<br />
<div style="text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafJl_EgzIS-T8qwd-ghqOwtz8zWYVIosvDg-08z2Wx0KKPp6z2VZfhHNO72d30G5j5lVEh6abl2KaRvVnHoFJZiOKNT5DIUZ9jE7-3k-0HG6CwV4iFRgvwSzD2Ll8DXd7iP-ZA7-_AW9z/s1600/Screen-Shot-2011-08-24-at-10.38.33-PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Define belongs to relationships" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafJl_EgzIS-T8qwd-ghqOwtz8zWYVIosvDg-08z2Wx0KKPp6z2VZfhHNO72d30G5j5lVEh6abl2KaRvVnHoFJZiOKNT5DIUZ9jE7-3k-0HG6CwV4iFRgvwSzD2Ll8DXd7iP-ZA7-_AW9z/s1600/Screen-Shot-2011-08-24-at-10.38.33-PM.png" title="Define belongs to relationships" /></a></div>
<div style="text-align: center;">
<br /></div>
<br />
We can now auto-complete these relationships.<br />
<br />
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0uhRHkU6fejKdkd23BaHia0rFjb77mBb7ZAc8AY4JnN46UutTgvmLWFvBoC1IHG7LPzywRUs-yZephBeYxvy-2YDPqLOiL-0dYQgIilljA_CsFh1BLuPpgd_hQMJuZ09znjJo16OmT3XO/s1600/Screen-Shot-2011-08-24-at-10.40.03-PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Auto-complete model relationships" border="0" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0uhRHkU6fejKdkd23BaHia0rFjb77mBb7ZAc8AY4JnN46UutTgvmLWFvBoC1IHG7LPzywRUs-yZephBeYxvy-2YDPqLOiL-0dYQgIilljA_CsFh1BLuPpgd_hQMJuZ09znjJo16OmT3XO/s320/Screen-Shot-2011-08-24-at-10.40.03-PM.png" title="Auto-complete model relationships" width="320" /></a></div>
<br /></div>
<br />
<h3>
Setting Up Helper Auto-completion in Views</h3>
<br />
To get auto-completion working in views we need to include a file created by <a href="https://gist.github.com/junichi11">junichi11</a> over at GitHub.<br />
<br />
Download this file and save it in a directory somewhere outside of your current project. I did this so I could use the same file on multiple projects.<br />
<ul>
<li><a href="https://gist.github.com/934219">CakePHP Helper Code Completion</a></li>
</ul>
Now add that directory to your current project.<br />
<br />
Open a view file and add the following variable definition.<br />
<br />
<pre class="brush: php; gutter: false;"> /**
*@var $this View
*/
</pre>
<br />
<br />
You should now be able to auto-complete helpers in your view!<br />
<br />
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU6IlrbcJNlU8P1PHkCDeRwuHbWedyUNzfMOoDhSYqgDSY4Z1aj6Jyw4RX8PgYGI2LpxLht1V58Bnh2pn2-fY7fpplz2MfX1HXbZEIkeXl-mnZXVGB6ClyhXUCx4J1D7-FNk6-YbIIyIfb/s1600/Screen-shot-2011-08-25-at-1.23.03-PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Auto-completion of helpers" border="0" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU6IlrbcJNlU8P1PHkCDeRwuHbWedyUNzfMOoDhSYqgDSY4Z1aj6Jyw4RX8PgYGI2LpxLht1V58Bnh2pn2-fY7fpplz2MfX1HXbZEIkeXl-mnZXVGB6ClyhXUCx4J1D7-FNk6-YbIIyIfb/s320/Screen-shot-2011-08-25-at-1.23.03-PM.png" title="Auto-completion of helpers" width="320" /></a></div>
<br /></div>
<br />
<h3>
Core Component Auto-Completion</h3>
<br />
Add the following to your app_controller.php file and this will add component auto-completion.<br />
<br />
<pre class="brush: php; gutter: false;"> /**
* CakePHP Component & Model Code Completion
* @author junichi11
*
* ==============================================
* CakePHP Core Components
* ==============================================
* @property AuthComponent $Auth
* @property AclComponent $Acl
* @property CookieComponent $Cookie
* @property EmailComponent $Email
* @property RequestHandlerComponent $RequestHandler
* @property SecurityComponent $Security
* @property SessionComponent $Session
*/
</pre>Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com33tag:blogger.com,1999:blog-7009744975932172381.post-27743953163033204622010-04-21T16:45:00.000-04:002012-07-31T09:45:21.319-04:00SABnzbd URL Bookmarklet (NZBMatrix)Here's a simple bookmarklet that will take the URL of the current page you're on and tell SABnzbd to download it. It works great if you're using NZBMatrix and on the page for the post you're wanting to download. Perfect for your mobile browser.<br />
<br />
<pre class="brush: jscript">javascript:location.href='http://yourhost:8080/api?mode=addurl&name='+encodeURIComponent(location.href)+'&apikey=yourapikey';
</pre>
<br />
Be sure to insert your SABnzbd API key and hostname (or IP address) into the bookmarklet's code.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com2tag:blogger.com,1999:blog-7009744975932172381.post-77707251133828509952010-01-20T15:37:00.000-05:002012-07-31T10:19:16.371-04:00Perl Find and Replace One LinerI'm constantly needing a way to easily change a line in a bunch of configuration files. I thought I'd share the way I do it here.<br />
<br />
<pre class="brush: bash; gutter: false;">perl -p -i -e 's/oldstring/newstring/g' *</pre>
<br />
This allows you to use a regular expression and perform the find and replace.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com2tag:blogger.com,1999:blog-7009744975932172381.post-40882047087575131632009-06-24T06:03:00.000-04:002018-06-29T08:41:36.485-04:00HOWTO: Set the SSHD Idle TimeoutHere's something that I usually forget to change from the default and then get annoyed when my terminal hangs.<br />
<ol>
<li>As root open your sshd_config file in an editor.<br /><pre class="code">su -
vim /etc/ssh/sshd_config
</pre>
</li>
<br />
<li>Add the following lines.<br /><pre class="code"> ClientAliveInterval 600
ClientAliveCountMax 3</pre>
</li>
<br />
<li>Restart the sshd process.<br /><pre class="code"> service sshd restart</pre>
</li>
</ol>
That's it. That will keep you logged in for 30 minutes at a time without activity. (600 seconds x 3)Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com8tag:blogger.com,1999:blog-7009744975932172381.post-44114740140286738372009-04-04T11:58:00.000-04:002012-07-31T09:57:53.868-04:00M3U Playlist Copy ScriptA couple of months ago I picked up a Garmin Nuvi 760 on the cheap. As it turns out this great GPS unit can also play music quite well, especially for riding on the motorcycle. The only problem was there was no good way to get playlists on the device that I could find. Enter the following bash script. This script will read an m3u file, copy all associated mp3 files, and generate a new m3u file. Now all I have to do is specifiy m3u files that I exported from <a href="http://www.getsongbird.com/">Mozilla Songbird</a> and the path to the Garmin's SD card.<br />
<br />
<pre class="brush: bash"> #!/bin/bash
# April 4, 2009
# m3u_cp.sh
#
# Take an m3u file and copy all associated mp3 files
# to a destination directory and generate a new m3u.
#
# Used to copy m3u playlists from computer to Garmin.
if [ $# -lt 2 ]; then
echo "Usage: m3u_cp.sh some.m3u /dst"
exit 0
fi
# Read the m3u file into an array
declare -a M3U
exec 10<"$1"
let count=0
while read LINE <&10; do
M3U[$count]=$LINE
((count++))
done
exec 10>&-
# Determine the m3u's filename
if [[ $1 =~ [^/]*m3u ]]; then
m3u_path="$2/$BASH_REMATCH"
fi
# If playlist arleady exists, delete it
if [ -f "$m3u_path" ]; then
rm -f "$m3u_path"
fi
# Loop through the m3u lines
i=0
while [ $i -lt ${#M3U[@]} ]; do
# The current line is a comment, do nothing with it
if [ ${M3U[$i]:0:1} = "#" ]; then
echo ${M3U[$i]} >> "$m3u_path"
#Current line is a path to an mp3 file
else
# Get the current songs filename
if [[ ${M3U[$i]} =~ [^/]*mp3 ]]; then
song=$BASH_REMATCH
mpath=$( echo ${M3U[$i]} | tr -d '\r' )
# if the song doesn't exist, copy it to the desitnation folder
if [ -f "$2/$song" ]; then
echo File Exists -- $song
else
echo Copying -- $song
cp "$mpath" "$2/$song"
fi
# Write the song in the m3u file
echo $song >> "$m3u_path"
else
echo "The regex for finding the song's filename is fraked up."
fi
fi
let i=i+1
done
exit 0
</pre>
<br />
In the middle of writing this I really started wondering why I used bash. Perl would've been a lot easier.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com11tag:blogger.com,1999:blog-7009744975932172381.post-19386017139658501542009-03-11T05:57:00.000-04:002012-07-31T09:59:57.392-04:00SVN+SSH Howto: Subversion Quick and SimpleHere's a quick and simple way to create a Subversion repository while maintaining security by using SSH and the filesystem permissions.<br />
<ol>
<li>Create users and add them to a group. There are a bunch of different ways to do this. I am only showing you how to create a group.<pre class="brush: bash">groupadd svn-users</pre></li>
<br />
<li>Make a directory to house the repository.<pre class="brush: bash">mkdir /var/lib/project</pre></li>
<br />
<li>Create the repository.<pre class="brush: bash">svnadmin create /var/lib/project</pre></li>
<br />
<li>Change permissions to allow the group read/write access.<pre class="brush: bash">cd /var/lib/project<br />chgrp svn-users db db/transactions db/write-lock db/revs db/revprops hooks locks<br />chmod 2770 db db/transactions db/revs db/revprops<br />chmod 660 db/write-lock<br />chmod 750 hooks<br />chmod 770 locks</pre></li>
</ol>
You can now have your users access the repository over SSH.<br />
<br />
<pre class="brush: bash">svn+ssh://username@server.example.com/var/lib/project</pre><br />
If your clients are on Windows, I recommend using <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a>.<br />
<br />
Credit goes to the <a href="http://reallylongword.org/svn/">Carnival of Technology</a>.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com0tag:blogger.com,1999:blog-7009744975932172381.post-83045379727928221982008-06-27T11:25:00.000-04:002012-07-31T10:01:37.360-04:00HTTP to HTTPS Forwards PleaseWhy do some sites that require a secure connection not automatically forward you to the secure site? How hard is it to do? Not very! (with Apache at least)<br />
<br />
<pre class="brush: plain"> #How about a simple .htaccess file in the webroot?
#Force SSL for example.hwarf.com
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]</pre>
<br />
Hopefully some sites will pay attention to this. I'm not mentioning any URLs.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com1tag:blogger.com,1999:blog-7009744975932172381.post-73839759694278169592008-05-30T16:43:00.000-04:002012-05-08T10:09:16.641-04:00Time Warner Cable / Road Runner - The Rip OffAfter 6 months with Time Warner Cable's Road Runner Internet service at home I was hit with a nice surprise. Month 7th would cost me $70.95, instead of the $44.95 that was/is advertised on their site. For some reason my location does not get their standard pricing. While my initial service was great, below I've identified some issues I have with Time Warner that has led me to cancel my account.<br />
<ul>
<li><strong>Their 800 Number -</strong> Whenever I try to call their customer support number I have to call at least five to ten times to get through. For some reason I keep getting a busy signal. Annoying!</li>
<br />
<li><strong>Hold Times -</strong> It takes about 10-15 minutes to get someone on the phone. I really wish I would've bought a speakerphone.</li>
<br />
<li><strong>Getting Bounced Around -</strong> During my first of three calls I was bounced around to three different operators that could not help me. However, before I reached the third person I was conveniently lost in phone-space and had to call back.</li>
<br />
<li><strong>Lack of Logic -</strong> There was no good explanation as to why the Road Runner service costs so much more in my area than someone who lives a couple miles from me.</li>
<br />
<li><strong>Customer Support Staff -</strong> While the staff was very nice, they were unable to help me. It was quite frustrating having someone tell me, "I agree that $70.95 is ridiculous and I have no idea why it is priced that way. I can understand why you would want to cancel."</li>
</ul>
As of next week I will no longer be a Road Runner customer and have since signed up with the Windstream Greenstreak service. The biggest disappointment about their DSL service is that they claim I only qualify for 3Mbps service. After living with 7Mbps and 15Mbps for the last year and a half, 3Mbps is going to feel pretty slow. I guess no more streaming HD movies from the iTunes store to the AppleTV.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com0tag:blogger.com,1999:blog-7009744975932172381.post-53588145020302501002008-02-27T06:28:00.000-05:002012-05-08T10:09:35.108-04:00Googlebot and FreeDNS from afraid.orgBack on January 8th I canceled my Dreamhost account and began hosting my site off of my cable modem. Only receiving ~15 hits a day I figured I might as well save myself $120 a year. So I chose <a href="http://freedns.afraid.org/" target="_blank">freedns.afraid.org</a> to host my DNS. They were free and had all the options that I wanted, including working with <a href="http://www.polarcloud.com/tomato" target="_blank">Tomato</a>.<br />
<br />
After the switch I noticed that my traffic had declined dramatically, down to ~1 hit per day. So I starting doing a bit of investigating and found that Google was no longer crawling my site and had deleted my previous results. Logging into the <a href="http://www.google.com/webmasters/tools/" target="_blank">Google Webmaster Tools</a> I found that Google was having DNS issues connecting to my site. Well, after pulling my hair out for an evening I found that FreeDNS was blocking the googlebot from crawling my site.<br />
<br />
Solution: I have switched my DNS provider to <a href="http://www.zoneedit.com/" target="_blank">ZoneEdit</a>. ZoneEdit offers similar features to that of FreeDNS. Now Google can access my site again, but I'm no longer in the results for some searches. I guess it will take some time. Yahoo and Live search were totally unaffected by FreeDNS.<br />
<br />
So this is a warning to all people using FreeDNS and want Google to crawl their site.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com2tag:blogger.com,1999:blog-7009744975932172381.post-51334934394826246472008-02-21T11:29:00.000-05:002012-07-31T10:07:02.516-04:00Installing Netbackup Enterprise Server 6.5 on CentOS 5 / RHEL 5 withSELinuxIt took me almost a whole day to come up with this solution. This should get Veritas Netbackup Enterprise Server 6.5 up and running on a CentOS 5 / RHEL 5 box with SELinux enabled.<br />
<br />
<br />
<strong>HOWTO: Server</strong><br />
<ol><br />
<li>Install a couple of dependencies:<br /> <pre class="brush: bash; gutter: false;">yum install compat-libstdc++-296 xinetd libXp </pre></li>
<br />
<li>Make sure that the hostname is set correctly. This is very important.</li>
<br />
<li>Temporarily disable SELinux:<br /> <pre class="brush: bash; gutter: false;">setenforce 0</pre></li>
<br />
<li>Untar the installation files:<br /> <pre class="brush: bash; gutter: false;">tar xvf NetBackup_6.5_LinuxRedhat2.6.tar.gz<br />tar xvf NetBackup_6.5_ICS_LinuxX86.tar.gz</pre></li>
<br />
<li>Start the installation: <br /> <pre class="brush: bash; gutter: false;"> ./NB_65_LinuxR_x86_20070723/install<br />.....<br />#ICS Directory: ./NB_65_ICS_1.4.37.0_LinuxX86/</pre><br /> </li>
<br />
<li>Fix SELinux: <br /> <pre class="brush: bash; gutter: false;">chcon -t textrel_shlib_t /usr/openv/lib/*<br />setenforce 1</pre><br /> </li>
<br />
<li>Start Netbackup: <br /> <pre class="brush: bash; gutter: false;">/etc/init.d/netbackup start</pre></li>
</ol>
<br />
<strong>HOWTO: Client</strong><br />
<ol><br />
<li>Untar the installation file: <br /> <pre class="brush: bash; gutter: false;">tar xvf NetBackup_6.5_CLIENTS2.tar.gz</pre></li>
<br />
<li>Start the installation: <br /> <pre class="brush: bash; gutter: false;">NB_65_CLIENTS2_20070723/install</pre></li>
<br />
<li>Fix SELinux issues: <br /> <pre class="brush: bash; gutter: false;">chcon -t textrel_shlib_t /usr/openv/lib/*</pre></li>
<br />
<li>Start the client: <br /> <pre class="brush: bash; gutter: false;">/etc/init.d/nbclient start</pre></li>
</ol>Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com2tag:blogger.com,1999:blog-7009744975932172381.post-38733023176766288302007-10-11T11:49:00.000-04:002012-07-31T10:06:51.486-04:00SELinux, Apache, phpMyAdmin, and a Remote MySQL ServerToday I ran into a little problem with phpMyAdmin talking to a remote MySQL server on a CentOS 5 machine. When I would try to connect to the server it would say that the host could not be reached. However, if I used the mysql cli I was able to connect. It turns out that the SELinux policy was prohibiting me from accomplishing this.<br />
<br />
To fix this problem you need to modify the policy with the following command.<br />
<pre class="brush: bash; gutter: false;">
setsebool -P httpd_can_network_connect=1</pre>
<br />
This change is instant and persistent, so it will survive a reboot.Anonymoushttp://www.blogger.com/profile/00223644726632115247noreply@blogger.com3