Search Results

Search: Posts Made By: dheian
1,822
Posted By dheian
Executing a command line in a directory and its subdirectories
I'm finally about to make the jump from PHP's mysql driver to the newer mysqli one using the mysqli converter tool.

The tool is called by this command line:
php...
2,039
Posted By dheian
Thanks. I just ran it and it worked. Phew! ...
Thanks. I just ran it and it worked. Phew!

So in future, is there a way for me to type an entity in the forum w/o the forum changing it to the character? I thought the code tags might do it.
2,039
Posted By dheian
Ok, so would it be this: sed...
Ok, so would it be this:

sed 's/'/\\\'/g' test.sql > withslashes.sql
with one slash to escape the backslash and one to escape the &? do I need to escape it in the left part as well?
...
2,039
Posted By dheian
I'll clarify my question. I found it difficult to...
I'll clarify my question. I found it difficult to post because my searches included html entities and the forum software was translating them into characters. The apos was just meant to represent the...
2,039
Posted By dheian
Sed: how do I insert a \ in my replace
I'm in the process of being forward-thinking and finally converting my site's db to UTF-8. I've already done the UTF-8 conversion (on a copy for testing) and now I want to go through and convert html...
5,775
Posted By dheian
CentOS
CentOS
5,775
Posted By dheian
I'll give that a try. Digging further, will this...
I'll give that a try. Digging further, will this work for the chown?

find /usr/local/apache/htdocs \! -user apache -print0 | xargs -0 chown apache:apache

---------- Post updated at 03:10 PM...
5,775
Posted By dheian
Find only files/directories with different permissions/owners
My git post-update has the following lines in it to make sure the permissions are set right:

find /usr/local/apache/htdocs -type d -print0 | xargs -0 chmod 755
find /usr/local/apache/htdocs -type...
5,414
Posted By dheian
Thanks.
Thanks.
5,414
Posted By dheian
I added -v to the chown command but I'm not...
I added -v to the chown command but I'm not getting any output...perhaps because the script is run over ssh and there's !requiretty in the sudoer? I guess I could try piping the output into a file?
...
5,414
Posted By dheian
Chmod working in sudo run script but chown isn't
My git user has permission in sudoers to run a wrapper script to move files into my webroot.

Everything is working fine except for the chown line. After the script has run, the files ar still...
2,288
Posted By dheian
It finally finished. It was a handbrakeCLI...
It finally finished. It was a handbrakeCLI command run as a user job by MythTV.
2,288
Posted By dheian
Seeing output of background process
I'm pretty sure I had the answer to this months ago and have misplaced it. Needless to say I will bookmark it this time.

I have a background process that's been running way longer than usual. It...
Forum: Cybersecurity 04-05-2011
2,078
Posted By dheian
Permissions for Backup user to rsync files
I've got a new MythTV box at home and figured it would be a great opportunity to use it to do daily mirrors of my mysqlbackup directory (let's say /mysqlbackup/backups) and my website at...
1,314
Posted By dheian
the system perl was 5.8.0 the one I installed...
the system perl was 5.8.0 the one I installed last night was 5.12
1,314
Posted By dheian
Reverting to system Perl - downgrading
Not how I expected my weekend to go.

My redhat server previously had perl 5.8.0 installed on it. Downloading a mysql utility, it asked for that and I blindly installed it. Broke a whole bunch of...
13,467
Posted By dheian
Dropping the -print0 worked like a charm. ...
Dropping the -print0 worked like a charm.

Thanks!
13,467
Posted By dheian
Runningfind /usr/local/apache/htdocs -name photos...
Runningfind /usr/local/apache/htdocs -name photos -print0 | xargs -i{} cp {} {}.php gave me the following:

cp: `/usr/local/apache/htdocs/academy/73/photos' and...
13,467
Posted By dheian
When I ran: find /usr/local/apache/htdocs...
When I ran:

find /usr/local/apache/htdocs -name photos -print0 | xargs -I{} cp {} {}.php

I got a "xargs: invalid option -- I".

Looks like I have an older version of xargs. Off to upgrade! :)
13,467
Posted By dheian
copy files with new extension in same directory
I've been able to find all the extensionless files named photos using the command:

find /usr/local/apache/htdocs -name photos -print0

I need to copy those files to the name photos.php in their...
4,813
Posted By dheian
That's correct. I was running as root. I see from...
That's correct. I was running as root. I see from man sed that the -c switch should do the trick:

-c, --copy

use copy instead of rename when shuffling files in -i mode
...
4,813
Posted By dheian
No, nginx. Apparently the sed changing ownership...
No, nginx. Apparently the sed changing ownership issue can be fixes by adding the -c switch to the sed command.
4,813
Posted By dheian
After running that command, the last modified...
After running that command, the last modified file date of every file on the server, .html files, jpgs, gifs, everything change to the time and date I ran the command. Files that did not contain the...
4,813
Posted By dheian
Search and replace without changing ownership
I found this search and replace method on another site:

find . -type f -print0 | xargs -0 sed -i 's/find/replace/g'

It worked fine except for the fact that it changed ownership on all the files...
Forum: Cybersecurity 12-08-2009
5,223
Posted By dheian
After pulling my hair out tonight, I realized...
After pulling my hair out tonight, I realized that I can just head to a coffee shop tomorrow and SSH in from there to do the file edits. Still, the wait's killing me.
Showing results 1 to 25 of 34

 
All times are GMT -4. The time now is 07:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy