9
Nov
$ find targetdir -type f | wc -l
-type f ensures that the find command only returns regular files for counting (no subdirectories).
By default, the find command traverses into subdirectories for searching. -maxdepth 1 prevents find from traversing into subdirectories.
Note that the find command does NOT classify a symbolic link as a regular file. Therefore, the above find -type f command does not return symbolic links. As a result, the final count excludes all symbolic links.
To include symbolic links, add the -follow option to find.
$ find targetdir -type f -follow | wc -l
2
Nov
‘easy way’ – via Internet.
In order to update the repositories, use this command:
sudo apt-get update
Use this command if you want to upgrade the packages of the currently installed version:
sudo apt-get upgrade
If you want to upgrade to the newest version of Ubuntu, use this command:
sudo apt-get dist-upgrade
1
Nov
Create a php.ini file with just the following line in it:
Upload it to the root of your “administrator” directory. Go back into extension manager > update. Purge the cache, then click Find Updates. Let me know if it works for you too.
27
Oct
Make a clean / custom ssh login.
Edit and change the variables in ”/etc/ssh/sshd_config”
PrintLastLog no
Banner /etc/ssh/sshd-banner
Then create the file sshd-banner text file. Use vi. This is what comes up after the username. The file can be something like this:
This is a private computer system which is
restricted to authorized individuals.
Actual or attempted unauthorized use of this
computer system will result in criminal
and/or civil prosecution.
Any information obtained by monitoring,
reviewing or recording is subject to review
by law enforcement organizations in
connection with the investigation or
prosecution of possible criminal activity on
this system.
We reserve the right to view, monitor and
record activity on the system without notice
or permission. Any information obtained by
monitoring, reviewing or recording is subject
to review by law enforcement organizations in
connection with the investigation or
prosecution of possible criminal activity
on the system. If you are not an authorized
user of this system or do not consent to
continued monitoring, exit the system at
this time.
Next we will remove the Regents of the University of California Copyright Notice. The Copyright notice acts a bit peculiar. It depends on the file COPYRIGHT (All In Capitals). which has it’s place in /etc as well.
As root:
touch /etc/COPYRIGHT
And last but not least the FreeBSD tip or “Fortune”. This is controlled from within your profile in your home dir. So let’s remove this as well. Remove the following line in your login user’s .profile
[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips
10
Oct
- Only users in the wheel group can run su.
- Add your regular user you want to su to the “wheel” group
- vi /etc/group
- wheel:*:0:root,john
- su -
- enter the root pass.
- have fun.
10
Oct
1) Use ifconfig command as follows:
ifconfig interface inet IP
Example(s):
ifconfig re0 inet 192.168.1.110
Note re0 is Ethernet interface name can be Obtained using ifconfig -a command.
2) To setup up ip permanently open file /etc/rc.conf ; add/modify network entries:
vi /etc/rc.conf
And setup values as follows:
hostname=”server.lab.lan”
ifconfig_lnc0=”inet 192.168.0.6 netmask 255.255.255.0″
Note ifconfig_lnc0 is Ethernet interface name can be Obtained using ifconfig -a command.
3) Again re-run /etc/netstart script.
10
Oct
The following assumes you’re installing with the CD with a 40 GB hardrive.
Fdisk Partitiong Screen:
Here’s my breakdown using my 40GB. Your needs may be different. Note you can toggle “Size(ST)” to Size(GB) by pressing “Z”
——————————————————————————————–
/ = 10GB (doesn’t really grow in size)
swap = 2GB (twice the amount of ram I have)
/tmp = 10GB (scratch area for various data collection so I don’t fill up root)
/var = 18GB (program and log slice – to prevent filling up the root parition)
——————————————————————————————–
Total: 40GB
Don’t forget to set your root partition to active or it won’t boot.
FreeBSD Disklabel Editor
ad0s1 = /
ad0s2 = swap
ad0s3 = /tmp
ad0s4 = /var

“Q” to quit this screen and resume your installation. Have fun.
4
Sep
- sudo apt-get install dkms build-essential linux-headers-generic
- Mount Virtualbox ISO Image by clicking on Devices > Install Guest Additions… in the Virtualbox Guest window that is currently running your Linux OS (Guest).
- sudo mount /dev/cdrom /media/cdrom
- cd /media/cdrom
- sh ./VBoxLinuxAdditions.run
- You may have to softlink the “build” directory
3
Sep
Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.
Install webmin on ubuntu 11.04 (Natty) server
We have already discussed how to install ubuntu 11.04 LAMP server now we will install webmin for easy administartion
Edit /etc/apt/sources.list file
sudo vi /etc/apt/sources.list
Add the following lines
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
Save and exit the file
Now you need to import GPG key
wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
Update the source list
sudo apt-get update
Install webmin
sudo apt-get install webmin
Now you need to access webmin using http://serverip:10000/ once it opens you should see similar to the following screen