- Κώδικας: Επιλογή όλων
my_script
από οποιονδήποτε φάκελο μου λέει command not found. Μήπως δεν καταλαβαίνω κάτι;
Συντονιστής: konnn
my_script
K Debian Testing 64bit|Ιntel i5 3rd|8GBRam|IntelHD4000 D Ευρετήριο οδηγών και how-to | Τερματικό για..αρχάριους E Ρώτα με τον έξυπνο τρόπο | Οδηγίες για νέους | |
#!/bin/bash
for file in *
do
echo Converting $file to UTF8 character set;
iconv -f iso-8859-7 -t utf8 $file > UTF$file
echo Done;
done
#!/bin/sh
# This script does personal backups to a rsync backup server. You will end up
# with a 7 day rotating incremental backup. The incrementals will go
# into subdirectories named after the day of the week, and the current
# full backup goes into a directory called "current"
# tridge@linuxcare.com
# directory to backup
BDIR=$Ηομε
# excludes file - this contains a wildcard pattern per line of files to exclude
EXCLUDES=$HOME/cron/excludes
# the name of the backup machine
BSERVER=server
# your password on the backup server
#export RSYNC_PASSWORD=XXXXXX
########################################################################
BACKUPDIR=`date +%A`
OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES
--delete --backup --backup-dir=/$BACKUPDIR -a"
export PATH=$PATH:/bin:/usr/bin:/usr/local/bin
# the following line clears the last weeks incremental directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
rsync --delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/
rmdir $HOME/emptydir
# now the actual transfer
rsync $OPTS $BDIR $BSERVER::$USER/current
#vars for better maintainance
nfs_path=
smb_path=
mybook_path=
#create file system structure fo sharing
mkdir $nfs_path
mkdir $smb_path
mkdir $ftp_path
mkdir $mybook_path
chown nobody:nogroup $nfs_path -R
chmod a=rwx $nfs_path -R
chown nobody:nogroup $smb_path -R
chmod a=rwx $smb_path -R
chown nobody:nogroup $mybook_path -R
chmod a=rwx $mybook_path -R
#Nfs
apt-get install nfs-kernel-server
cp /etc/exports /etc/exports.original
echo ${nfs_path}" 192.168.0.3(rw,sync,no_root_squash,no_subtree_check)" >> /etc/exports
echo ${nfs_path}" 192.168.0.4(rw,sync,no_root_squash,no_subtree_check)" >> /etc/exports
echo ${nfs_path}" 192.168.0.2(rw,sync,no_root_squash,no_subtree_check)" >> /etc/exports
echo ${mybook_path}" 192.168.0.4(rw,sync,no_root_squash,no_subtree_check)" >> /etc/exports
/etc/init.d/nfs-kernel-server restart
#SSH
apt-get install openssh-server
#Samba
apt-get install samba
cp /etc/samba/smb.conf /etc/samba/smb.conf.original
echo [shared] >> /etc/samba/smb.conf
echo " comment = Server Shared File System" >> /etc/samba/smb.conf
echo " path = "${smb_path} >> /etc/samba/smb.conf
echo " browsable = yes" >> /etc/samba/smb.conf
echo " guest ok = yes" >> /etc/samba/smb.conf
echo " read only = no" >> /etc/samba/smb.conf
echo " create mask = 0755" >> /etc/samba/smb.conf
/etc/init.d/samba restart
#MySQL
apt-get install mysql-server
/etc/init.d/mysql restart
netstat -tap | grep mysql
#Php
apt-get install php5
apt-get install php5-cli
apt-get install php5-mysql
#Apache and modules
apt-get install apache2
cp site /etc/apache2/sites-available/site #Assuming a configuration file named site exists in the same dir
cp /etc/apache2/ports.conf /etc/apache2/ports.conf.backup
cp ports.conf /etc/apache2.ports.conf
echo "ServerName ******" >> /etc/apache2/httpd.conf
a2ensite site
a2dissite default
apt-get install libapache2-mod-auth-mysql
a2enmod auth_mysql
apt-get install libapache2-mod-php5
a2enmod php5 #Usally Already Enabled
/etc/init.d/apache2 restart
#Permanent mount of externall My Book
cp /etc/fstab /etc/fstab.backup
echo "#My Book" >> /etc/fstab
echo UUID=******** ${mybook_path} ext4 auto,sync,rw,exec,user,rw 0 1
echo "\n" >> /etc/fstab
mount -a
#rsync Backup
apt-get install rsync
#First Maintenance
apt-get update
apt-get upgrade
apt-get autoremove
K Debian Testing 64bit|Ιntel i5 3rd|8GBRam|IntelHD4000 D Ευρετήριο οδηγών και how-to | Τερματικό για..αρχάριους E Ρώτα με τον έξυπνο τρόπο | Οδηγίες για νέους | |
Winterfellow έγραψε:Ευχαριστω πολύ για την καθοδήγηση. Αγορασα και το Learning the bash shell ισως με βοηθησει.
#!/bin/bash
xset q | grep "Monitor\ is \On"
if [ $? -eq 0 ]; then
qdbus org.ktorrent.ktorrent /settings org.ktorrent.settings.setMaxUploadRate 15
else
qdbus org.ktorrent.ktorrent /settings org.ktorrent.settings.setMaxUploadRate 0
fi
exit 0;
*/1 * * * * DISPLAY=:0.0 /home/ftso/bin/ktorrentuploadspeed
K Debian Testing 64bit|Ιntel i5 3rd|8GBRam|IntelHD4000 D Ευρετήριο οδηγών και how-to | Τερματικό για..αρχάριους E Ρώτα με τον έξυπνο τρόπο | Οδηγίες για νέους | |