Commands: Difference between revisions

From Halfface
Jump to navigation Jump to search
No edit summary
No edit summary
Line 60: Line 60:
         server_args = 172.28.37.152 6000
         server_args = 172.28.37.152 6000
}
}
</pre>


  reboot
  reboot
 
  Hard reboot mean that shutdown scripts will not run and machine reboot immediately without syncing hard disk drives, shutdown applications etc.
  Hard reboot mean that shutdown scripts will not run and machine reboot immediately without syncing hard disk drives, shutdown applications etc.
  echo 1 > /proc/sys/kernel/sysrq
  echo 1 > /proc/sys/kernel/sysrq
Line 71: Line 72:
   
   
  echo 1 > /proc/sys/kernel/sysrq  
  echo 1 > /proc/sys/kernel/sysrq  
  echo o > /proc/sysrq-trigger  
  echo o > /proc/sysrq-trigger
</pre>

Revision as of 13:09, 18 January 2007

putty -l bjorklun -pw password -L 19242:192.168.0.42:3389 blt.homeip.net

dd if=/dev/hda of=/dev/fd0 bs=512 count=1

bash:
Get a list from 01 to 99.
for ((a=100;a <= 199 ;a++)); do echo "$a"; done | cut -b2-3

install src.rpm
rpmbuild --rebuild alien-6.51-1.src.rpm
rpm -i /usr/src/redhat/RPMS/x86_64/alien-6.51-1.rpm

List contents of rpm.
rpm -qlp myfile.rpm

Extract contents of rpm.
rpm2cpio *.rpm | cpio -i --make-directories

Clean file from comments and blank lines.
sed '/ *#/d; /^ *$/d'

Update release area Windows.
servicepack.exe -s:z:\w2k3

Syncronize folders.
rsync --delete -az -e ssh acrobatreader acdse office2003 java nortonantivirus bjorklun@semco.homeip.net:/install/program/windows/

crontab.
* * * * *  command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday

Automated login on a user basis.
ssh-keygen -t dsa                    Generate personal ssh keys.
cat id_dsa.pub >> authorized_keys2   Copy your personal ssh key to all machines.
chmod 644 ~/.ssh/authorized_keys2    Verify correct access on files.

-forward traffic.
service x11
{
        disable = no
        socket_type = stream
        protocol = tcp
        wait = no
        user = root
        server = /usr/bin/nc
        server_args = 172.28.37.152 6000
}
reboot

Hard reboot mean that shutdown scripts will not run and machine reboot immediately without syncing hard disk drives, shutdown applications etc.
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
This commands enable sysrq and after this call fast reboot. If you want to force shutdown machine try this.
Force shutdown

echo 1 > /proc/sys/kernel/sysrq 
echo o > /proc/sysrq-trigger