UNIX: Difference between revisions

From John's wiki
Jump to navigation Jump to search
(New page: = General = To rip a CD/DVD ISO image: $ dd if=/dev/cdrom of=~/my.iso bs=1024 = Solaris = To [http://www.tech-recipes.com/solaris_system_administration_tips218.html|mount an ISO image...)
 
No edit summary
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= General =
To rip a CD/DVD ISO image with dd:


To rip a CD/DVD ISO image:
$ dd if=/dev/cdrom of=~/my.iso bs=1024
 
To [http://www.tech-recipes.com/solaris_system_administration_tips218.html mount an ISO image on Solaris]:
 
# mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt
 
To print the route table on Solaris/BSD:
 
# netstat -r
 
To get the number of seconds since 1970-01-01:
 
# date +%s
 
To get the date in the format yyyy-mm-dd-HHMMSS:
 
# date +%F-%H%M%S
 
To backup a MySql database:
 
# mysqldump -h localhost -u username -ppassword dbname > \
  /var/backups/dbname_`date +%F-%H%M%S`.sql
 
To give all users execute permissions to a file or set of files (by wildcard):
 
# chmod a+x eg*
 
Note: use -R to recursively apply to subdirectories.
 
To add a user to a .htpasswd file:
 
# htpasswd -b .htpasswd username password
 
If .htaccess file settings are not applying, [http://httpd.apache.org/docs/1.3/mod/core.html#accessfilename ensure they have not been disabled] with:
 
<Directory />
AllowOverride None
</Directory>
 
To figure out which binary runs when you issue a command, e.g.:
 
$ which less
 
The Sun Studio C++ compiler is CC, and the C compiler is cc.


  $ dd if=/dev/cdrom of=~/my.iso bs=1024
  CC takes arguments ending in .c, .C, .cc, .cxx, .c++, .cpp,
or .i to be C++ source programs. Arguments ending in .s are
presumed to be assembly source files.  Arguments ending in
.o are presumed to be object files.


= Solaris =
To connect to a windows SMB or linux Samba share from Mac OS X use the Finder "Connect to Server" function AppleKey+K and use the smb protocol prefix, e.g. smb://example/share, or smb://administrator@server.example.org/c$


To [http://www.tech-recipes.com/solaris_system_administration_tips218.html|mount an ISO image on Solaris]:
To force kill a process/window on Mac OS X:Option+Apple+Esc


# mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt
If you're having a problem with maintenance scripts not being run by cron: Don't use a dot (.) in the file name of scripts placed in cron.daily, cron.weekly, or cron.monthly directories, as this can interfere with them running. Make sure that the script has been marked executable.

Latest revision as of 18:46, 27 April 2008

To rip a CD/DVD ISO image with dd:

$ dd if=/dev/cdrom of=~/my.iso bs=1024

To mount an ISO image on Solaris:

# mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt

To print the route table on Solaris/BSD:

# netstat -r

To get the number of seconds since 1970-01-01:

# date +%s

To get the date in the format yyyy-mm-dd-HHMMSS:

# date +%F-%H%M%S

To backup a MySql database:

# mysqldump -h localhost -u username -ppassword dbname > \
  /var/backups/dbname_`date +%F-%H%M%S`.sql

To give all users execute permissions to a file or set of files (by wildcard):

# chmod a+x eg*
Note: use -R to recursively apply to subdirectories.

To add a user to a .htpasswd file:

# htpasswd -b .htpasswd username password

If .htaccess file settings are not applying, ensure they have not been disabled with:

<Directory />
AllowOverride None
</Directory>

To figure out which binary runs when you issue a command, e.g.:

$ which less

The Sun Studio C++ compiler is CC, and the C compiler is cc.

CC takes arguments ending in .c, .C, .cc, .cxx, .c++, .cpp,
or .i to be C++ source programs. Arguments ending in .s are
presumed to be assembly source files.  Arguments ending in
.o are presumed to be object files.

To connect to a windows SMB or linux Samba share from Mac OS X use the Finder "Connect to Server" function AppleKey+K and use the smb protocol prefix, e.g. smb://example/share, or smb://administrator@server.example.org/c$

To force kill a process/window on Mac OS X:Option+Apple+Esc

If you're having a problem with maintenance scripts not being run by cron: Don't use a dot (.) in the file name of scripts placed in cron.daily, cron.weekly, or cron.monthly directories, as this can interfere with them running. Make sure that the script has been marked executable.