User:Arch119
Manual of Style (MoS) |
---|
This page will be used for my personal use to store the knowledge as I gain it.
1) Manipulating .deb files --> Use dpkg-deb (dpkg can also be used).
2) Installing a .deb file --> dpkg install <package>.deb
1) To clear the terminal --> clear
2) Finding help about emacs or other commands
Emacs-->help-->Manuals---> Browse Manuals with info....
3) Emacs switching between windows
C-x o
4) rpm options
rpm -qa ---> rpm query all rpm -qi <package name> ---> query about package with name <package name> rpm -ql <package name> ---> query files installed by package <package name> rpm -qf <file name> ----> query package containing file <filename>
rpm -qxp <rpm file> ---> Querying downloaded (but yet to install packages). Replace x with any query options such as 'i' or 'l'.
rpm -U <rpm file> ---> Updates a package.. i.e. erases previous installed versions and installs a new package.
5) apropos, whatis ---> search command with keywords
6) makewhatis ---> make whatis database using man pages.
7) C-z --->suspending a job
jobs ---> display jobs bg <job number> ---> make the job <job number> a background job. fg <job number> ---> Similar.
8) du -s ---> size of current directory
du -s <folder> ---> total size of directory <folder>
9) last ---> displays a list of users last logged in
users, who, w ---> displays a list of currently logged in users
10) top ---> similar to taskmanager of windows
11) nmap localhost ---> shows open ports
10) free, vmstat, top ---> information about memory and processes.
11) /sbin/sysctl ---> change kernel parameters at runtime
/sbin/sysctl -a -->display all parameters
12) watch ---> execute a command periodically and see the output.
13) uname -a ----> system info.
13.5) How X starts(in runlevel 3): when "startx" is executed, which is just a frontend to xinit, it searches for .xinitrc in user's home directory and executes it. If not it executes /etc/X11/xinit/xinitrc which might in turn execute ~/.XClients .If it doesn't find ~/.Xclients it tries to execute /etc/X11/xinit/Xclients. In RedHat this script tries to read the user's preferred Desktop environment written in /etc/sysconfig/desktop and executes it.
14) Running twm instead of desktop environments like gnome,kde Set the runlevel to 3 in /etc/inittab (In runlevel 5 prefdm is executed which displays gdm ). copy /etc/X11/xinit/xinitrc to ~/.xinitrc and delete the conditionals on the final code block so that only "failsafe settings" gets started.
Delete this file and leave it to /etc/X11/xinit/xinitrc to start everything in order to start the desktop stated in /etc/sysconfig/desktop.
15) using fvwm2 instead of twm
download and install it somewhere lets say ~/fvwm2/ now instead of executing twm in .xinitrc, execute ~/fvwm2/bin/fvwm2.
16) file <filename> : find the type of file.
17) find <directory> -name <pattern> : find file whose name follow pattern <pattern> in the directory tree rooted at <directory>
18) change runlevel at runtime
/sbin/sysinit -t <timeinsecs> <runlevel>
eg sysinit -t 10 5
19) ldd ---> view shared library dependecies.
20) strace <executable> ---> Use to execute an executable and see all the system calls made by it.
21) DO NOT PUT KERNEL SOURCE INTO A DIRECTORY WHOSE NAME CONSISTS OF A SPACE.
Debian: Events after Installation
1) Installed debian..
2) Problem shows up...startx does't work startx in debian reads /etc/X11/xf86config-4 or something like that the vdo card setting was wrong. Ran Xf86config or something like that , the native X configurating program. It generated a new file in /etc/X11 called XF86config. Looked at it...the name of the driver was "ati".... So edited XF86config-4 to reflect this and twm worked. voila !!!!
3) all startup scripts are stored insided /etc/init.d/
Which of these are executed during startup depends upon the runlevel. for each runlevel i , there is a directory /etc/rci.d which contains symbolic links to certain scripts inside /etc/init.d/
4) Debian boot process: Kernel --> Init --> reads /etc/inittab . In inittab, it is stated that the first script to be executed is /etc/init.d/rcS...which in turn exectues other scripts in /etc/rcS.d.
Then depending upon the runlevel stated in /etc/inittab, the scripts in /etc/rcn.d/ are started.
5) Problems with Xserver.
when su-ed from arch119 session....cudn't run xclients....
Xlib: Client is not authorized to connect to Server error.
exectued "xhost +" as root...and worked...it probably lets anybody - any host or any user to use the xserver for display....... one more method is suggested as the use of "xauth" to configure authority.
6) manually renamed the scripts in /etc/rc2.d/ to stop them from running
renamed from : Sxxname to _Sxxname
7) Display installed packages : dpkg -l
8) mount cdrom before reading : mount /cdrom
9) removed cdrom from /etc/apt/sources.list and added ftp server of asahi-net. To read more on sources.list see its man page.
10) To display the files installed by a package dpkg -L <package>
11) Xclients couldn't display themselves in local Xserver when ssh-ed to chip.
The problem was in /etc/ssh/ssh_config file (not sshd_config : X forwarding
is enabled in chip's sshd_config) . Added a line "ForwardX11 yes" in local file /etc/ssh/ssh_config.
12) Logged in as arch119. su-ed to root but Xclients were not allowed to use the running Xserver. One solution is shown in (5). The other one is to start X once again as root but in a different display as in "startx -- :2" (:2 is the new display number).
13) added S20samba in /etc/rc2.d to start samba and added line to start swat in /etc/inetd.conf ...also added a line to map swat to tcp port 901 in /etc/services..... Workgroup :<MyWorkgroup> debian host name:<Myhostname> swat can be accessed using http session with <myhostname>:901
Still need to configure
14) Installed webmin ..... start script installed in /etc/init.d/ but not in /etc/rc<x>.d. Connect using https at port 10000 of localhost.Installed various modules for webmin like apache control module , wu-ftpd control module etc.
15) Installed wu-ftpd
16) Installed mysql-server. Configuration files in /etc/mysql/ and databases stored in /var/lib/mysql . One directory for each database.
Use GRANT and REVOKE to add/delete , change previleges of users.
17) Installed php4 and configured httpd.conf to load php module.
18) Installed php4-mysql, php4-pear and configured php.ini etc.
19) Installed phpMyadmin to administrate mySql database.
Access it using http://localhost/phpmyadmin The phpmyadmin is installed in /usr/share/phpmyadmin . Howerver there is an
alias added to it in httpd.conf. No security settings. the login name and pass for phpmyadmin is same as that for mysql. use root/<.....m.>
20) add a user to the system
useradd -m <username>
21) Installed tiki in /var/www/tiki......Enabled japanese by editing php.ini [mbstring] settings. [details in php site . search the topic "Multibyte String Functions".
22) Using analog to visualize apache logs.
go to /var/www/ and execute 'analog -O<outputfile>' view the report in browser http://localhost/<outputfile>.
23) configured httpd.conf so that system documentation can be browsed from
my subnet (22*.25*.23*.160/29) using http://<hostname>/doc/ and ~th/shared can be accessed using http://<hostname>/th/ . Added "Alias" directive in httpd.conf and added "<Directory> </Directory>" directive to allow access to the target folders.
24) added a file called analog in "/etc/cron.d" so as to execute analog and create apache stats file in /var/www/analog/ every 30 minutes.
25) 'strace' can be used to see the system calls made by an executable.
Can be used to reverse engineer a program <<<< cool.!!!!
26) added one line
smbd: ALL except 22*.25*.2**.160/255.255.255.248
to hosts.deny to refuse connections to netbios-ssn from anywhere except my subnet.
27) installed ns-allinone package in arch119 home. all package installed inside ns-allinone-2.28 or something. required to install Xlib-Devel for the packagest to compile. Edited .bashrc to add certain values to $PATH and $LD_LIBRARY_PATH
28) updated debian using sarge release notes. updated kernel as well.
useful programs: aptitude (new debian packet manager) script (records stdin /stdout)
29) modprobe <module> to load modules....from /lib/modules/`uname -r`.
lsmod, insmod etc
30) Iptables....not built in the kernel....are loaded as modules...
see the tutorials....
31) After the big upgrade from woody to sarge, Xserver stopped working because it replaced the old XF86config-4 file....but I had the old XF86config file created by XF86config....in the XF86config-4 file...changed the device name of graphics card to "ati" and commented out the line with Video RAM size.
32) changed keyboard map to "pc101" and layout ="us"... the backup of current xf86config-4 file is saved as .bak
33) Installed acL utility. Setfacl didnt work in the begining but started working once /etc/fstab was edited so that /dev/hda3 was mounted on /home with acl option on.
34) Installed exim4. The config file is /etc/exim4/exim4.conf.template. But set the parameters of update-exim4.conf.conf using dpkg-reconfigure exim4-config, which will build the exim4 config file (/var/lib/exim4/config.autogenerated)using exim4.conf.template and the newly set parameters. To read more about it see /usr/share/doc/exim4/README.debian
35) Installed awstats. Using it instead of analog. See /etc/crond.d/awstats for its usage.
36) Installed ntop. Should be run as user root as follows: ntop -d -w <port_to_listen_as_server> -u ntop
37) Setting up guest account in wu-ftpd start wu-ftpd (from inetd) with -a option so that it reads the /etc/wu-ftpd/ftpaccess file.
/var/guestftp is the place where all the guests are chrooted. See the users who are defined as guests in ftpaccess. Also see guest-root and restricted-uid directive.
/var/guestftp should have bin, lib, etc directories. bin for ls command. lib to place the libraries on which ls depend on and /etc should contains minimal versions of /etc/passwd and /etc/group.
in the real passwd file , don't forget to set the shell of guest user as /bin/false or any thing which cant be used as shell but dont forget to add it to /etc/shells otherwise wu-ftpd wont let login.
reference:ebook wu-ftpd and apache security basics
38) Set password for user "root" (arch119 pwd). use mysql -p -u root to login.
39) dpkg-deb -x <package.deb> <directory> --> extract files from a debian package.
40) Installing deb packages locally. ;;;;--> see file ./debianlocalinstall.howto
41) 'nm' -- to check symbols exported by an object file.
42) Basic Authentication in apache - see Apache Basic Authentication tutorial for details. To summarize:
a) add usernames to /etc/apache/passwd using htpasswd
htpasswd /etc/apache/passwd username
b) Edit /etc/apache/httpd.conf to add authorization info in the directories to be protected
c) use group file(/etc/apache/group) to group users.
Blah Blah
Enabling TCP/IP Forwarding in Windows XP
1) In Registry Editor, locate the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
2) Set the following registry value:
Value Name: IPEnableRouter Value type: REG_DWORD Value Data: 1
A value of 1 enables TCP/IP forwarding for all network connections that are installed and used by this computer.
- Using USB to connect to the internet:
- Enable Internet Connection Sharing for the interface connected to the Internet on the PC.
- In the zaurus, as root, add the IP address of the PC as default gateway. e.g.. If the IP address of the interface of PC connected to zaurus is 192.168.129.1 then, add the following route in zaurus:
route add default gw 192.168.129.1 (test ping <ip add>)
- To delete this default gateway use:
route del -net default gw 192.168.129.1