#16481 - 02/20/04 12:24 AM
Re: Bash Tips and Tricks
|
Joined: Feb 2002
Posts: 7,202
Gremelin
Community Owner
|
Community Owner

Joined: Feb 2002
Posts: 7,202
Likes: 11
Portland, OR; USA
|
If user is having an issue with Perl or PHP interpreters within the ensim service do the following:
sitelookup -s [username] sitelookup -d [domainname]
(be sure they match up, we're compairing the server validations of where the username belongs and where the domain name belongs to be sure we aren't working with the wrong account)
cd /home/virtual/[username]/fst/var/www ls
(we're trying to see if the interpreters directory exists, which it should, otherwise skip this step and the next step's RM)
ls interpreters
(If interpreters show up then there isn't a problem, if not, continue)
rmdir interpreters DisableVirtDomain [domain] EnableVirtDomain [domain]
(Here you tell the system to remove the interpreters directory, disable the account on the system, enable the account on the system. Re-enabling causes the Ensim service to rebuild all data).
ls interpreters
(interpreters should now exist, user account should now be able to use their account once again)
|
|
|
#16484 - 02/20/04 02:53 AM
Re: Bash Tips and Tricks
|
Joined: Sep 2002
Posts: 390
Shinobi
UGN Member
|
UGN Member

Joined: Sep 2002
Posts: 390
Asheville, NC
|
su and sudo ....they are the biggest time savers in the universe
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
|
#16489 - 03/02/04 09:58 AM
Re: Bash Tips and Tricks
|
Joined: Feb 2002
Posts: 7,202
Gremelin
Community Owner
|
Community Owner

Joined: Feb 2002
Posts: 7,202
Likes: 11
Portland, OR; USA
|
|
|
|
#16499 - 03/21/04 09:46 PM
Re: Bash Tips and Tricks
|
Joined: Jun 2002
Posts: 207
Gollum
Member
|
Member

Joined: Jun 2002
Posts: 207
US
|
these are shell scripts i had to write:
used this one when after converting rtf files to html, i had to move and rename them. well i didn't have to rename them, but i did b/c it made me feel better. the filenames were .rtf.html, and i wanted just .html moving multiple files and renaming them:
#!/bin/bash for x in *.rtf.html #lists all converted html files in current directory do i=$(ls $x | cut -d. -f 1) #displays the filename up to the first period. #for most files (in my case all of them) this will be the filename minus the extension echo "Moving $i..." mv $i.rtf.html /www/htdocs/$i.html #copy (or move, if you'd like to do that instead) all files to another directory and rename them done
this second one i used to automatically generate a page of links to the files i just copied:
#!/bin/bash rm index.html for x in *.html do i=$(ls $x | cut -d. -f 1) echo "<a href=$x>$i</a> " >> index.html done
pretty self explanatory. note that x is the full filename, and i is the filename without the extension.
i was setting up a large text section on my website, and so i used these two scripts in a cron job while having another program converting lots and lots of rtf files to html. it took a fairly long time, and so i set these up, so ppl could read the texts as they were generated and not have to wait for all of them to complete. speaking of which. does anyone know a really good rtf to html converter. i downloaded one that uses php. and yes it works. but it bloats the files big time. some of them end up being like 400-500k when all they need is 100k or so. needless to say very inefficient, especially when hosting from a cable connection. so if anyone has had any good results with certain conversion utilities, feel free to let me know.//
Unbodied unsouled unheard unseen Let the gift be grown in the time to call our own Truth is natural like a wind that blows Follow the direction no matter where it goes Let the truth blow like a hurricane through me
|
|
|
#16501 - 05/28/04 05:27 AM
Re: Bash Tips and Tricks
|
Joined: May 2004
Posts: 3
Wi1d
Junior Member
|
Junior Member
Joined: May 2004
Posts: 3
USA
|
Gollum try using pidof [process] instead of ps Thanks, that worked nicely sinetific. bye=`pidof xscreensaver` && kill $bye && echo proccess dies || echo no such process One of my favorites about bash is aliases. # emerge aliases
alias emask="echo `$1` /etc/portage/package.keywords"
alias es="emerge -s"
alias ep="emerge -pv"
alias e="sudo emerge"
alias emerge='sudo emerge'
# directory aliases
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias c="clear"
alias cb="bash_issue"
alias ls="ls --color=always"
alias ll="ls --color -l"
# misc aliases
alias grep='grep --colour=auto'
alias killwine="killall -9 wine; killall -9 wineserver"
alias recal="history | grep `$1`"
alias lock='xscreensaver-command -lock'
alias r00t='sudo -s -H'
alias svi='sudo vim'
alias smv='sudo mv'
alias vi="vim"
alias nat="nautilus --no-desktop"
alias 3d="sudo 3ddeskd --acquire 700 2>1&"
alias screengrab="import -window root ~/screen.jpg"
alias lvim='vim -c "normal '\''0"'
alias mkisofs="mkisofs -rJV"
alias torrget="btdownloadcurses.py --minport 50555 --maxport 65500"
alias cal2="cal -3; echo -e Todays date is `date +%B\ %d`"
alias scr="screen -r"
alias scl="screen -list"
alias nm="nmap -sS -O -PI -PT"
alias icq="screen -S icq centericq"
alias irc="screen -S irc irssi"
alias mp3="cd ~/music/full-albums/ && screen -S mp3 cplay"
alias get="cd ~/download/torrent-files/ && screen -S get"
I sig not
|
|
|
|
Forums41
Topics33,701
Posts68,795
Average Daily Posts0
|
Members2,173
Most Online1,567 Apr 25th, 2010
|
|
|
Okay WTF?
by HenryMiring on 09/27/17 08:45 AM
|
|
|
|
|
|
|
|