Friday, December 21, 2007

Another Refference, howto create Reposiory from ISO image

Take from
http://jogja.linux.or.id/berita/arsip/2007/05/15/bikin-repo-tanpa-repot-dari-iso/

15 May 2007

icon post title Bikin Repo Tanpa Repot Dari ISO

Oleh: pramur

Tulisan ini hanya sekadar (bukan ’sekedar’) penerjemahan dari tulisan bertajuk Just Do It w/ Ur ISOs. Kritik, saran, koreksi, apapun (duit mungkin?) sangat diharapkan.
Ada banyak jalan menuju surga. Begitu pula ada banyak cara membuat Repo. Repo di sini merupakan kependekan dari Repository. First think first, saya menggunakan Kubuntu Feisty Fawn (7.04) di Acer 3628 (Proc 1.7GHz, DDR2 1GB, 60GB HD, Grafis Intel GMA 900), Apache versi 2.2 sebagai testing (tidak harus Apache, tergantung nurani dan nafsu Anda). Satu hal, bahwa ISO yang saya gunakan adalah sudah DVD Repo. Jadi, misalnya Anda ingin membuat ISO Repo dari banyak sekali file *.deb, silahkan lihat tutorialnya di ubuntulinux [dot] or [dot] id [slash] blog [slash] ?p=272.


0. Mounting
Saya asumsikan Anda sudah memiliki repo berbentuk ISO, bisa didapat dari (mana lagi kalau bukan) kambing. ISO saya letakkan di
/home/pramur/exe/iso/ubuntu-7.04-i386-1.iso
/music/ubuntu-7.04-i386-2.iso
/music/ubuntu-7.04-i386-3.iso
dan /download/ubuntu-7.04-i386-2.iso
Boleh jadi Anda meletakkan di path berbeda, disesuai-in aja ya Bos?

Buka konsole, gnome-terminal, shell, apapun sebutan Anda buat yg layar-belakang-nya item trus ada tulisan aneh kedap-kedip (walau tak selalu). Mulai mendaki (mount) :)
$ sudo mkdir /media/iso1
$ sudo mkdir /media/iso2
$ sudo mkdir /media/iso3
$ sudo mkdir /media/iso4
$ sudo modprobe loop
$ sudo mount file_iso_1.iso /media/iso1/ -t iso9660 -o loop
$ sudo mount file_iso_2.iso /media/iso2/ -t iso9660 -o loop
$ sudo mount file_iso_3.iso /media/iso3/ -t iso9660 -o loop
$ sudo mount file_iso_4.iso /media/iso4/ -t iso9660 -o loop

Untuk menguji, ketik mount. Punya saya jadi seperti ini.
$ mount
/home/pramur/exe/iso/ubuntu-7.04-i386-1.iso on /media/iso1 type iso9660 (rw,loop=/dev/loop0)
/music/ubuntu-7.04-i386-2.iso on /media/iso2 type iso9660 (rw,loop=/dev/loop1)
/music/ubuntu-7.04-i386-3.iso on /media/iso3 type iso9660 (rw,loop=/dev/loop2)
/download/ubuntu-7.04-i386-4.iso on /media/iso4 type iso9660 (rw,loop=/dev/loop3)

Bila ingin memount tiap komputer nyala (maksudnya biar ga repot mesti ngetik kaya di atas tiap saat), edit file /etc/fstab. Tambahkan baris berikut.

/home/pramur/exe/iso/ubuntu-7.04-i386-1.iso /media/iso1 udf,iso9660 loop 0 0
/music/ubuntu-7.04-i386-2.iso /media/iso2 udf,iso9660 loop 0 0
/music/ubuntu-7.04-i386-3.iso /media/iso3 udf,iso9660 loop 0 0
/download/ubuntu-7.04-i386-4.iso /media/iso4 udf,iso9660 loop 0 0

1. Set Apache
Setting Apache di /etc/apache2/ jika belum berubah. Edit file apache2.conf dengan vi, vim, kate, gedit, kwrite, editor apapun sesuai selera dan nafsu. Tapi, saya suka vim. Looks like a sophisticated way, huh? :)

Bingung memandang semua tulisan aneh itu? Apalagi saya yg oon ini… Tapi, yang mau kita edit hanya bagian sahaja. Kata kitab, “… jika datang kepadamu orang fasik membawa suatu berita, maka periksalah dengan teliti agar kamu tidak menimpakan suatu musibah kepada suatu kaum tanpa mengetahui keadaannya yang menyebabkan kamu menyesal atas perbuatanmu itu”. Nah, oleh karena itu, kalau Anda belum yakin (sama saya), bek-ap dulu apache2.conf yang lama.

$ sudo cp apache2.conf apache2.conf.backup

Baru tambahin baris ini.

Alias /iso1/ “/media/iso1/”

Options Indexes Multiviews
AllowOverride None
Order allow,deny
Allow from all

Alias /iso2/ “/media/iso2/”

Options Indexes Multiviews
AllowOverride None
Order allow,deny
Allow from all

Alias /iso3/ “/media/iso3/”

Options Indexes Multiviews
AllowOverride None
Order allow,deny
Allow from all

Alias /iso4/ “/media/iso4/”

Options Indexes Multiviews
AllowOverride None
Order allow,deny
Allow from all

Sudah? Save perubahannya (di vim tinggal pencet :wq trus ENTER) dan restart apache.
$ sudo /etc/init.d/apache2 restart

Mungkin Anda bisa coba-coba dulu di browser, “http://localhost/iso1/”, “http://localhost/iso2/” dan seterusnya. Buat coba-coba kali ya bo…

2. Edit sources.list
Kalau Anda merasa repo yang Anda miliki sudah cukup membuat Anda puas lahir batin dunia akhirat, lupakan sumber yang lain, tambahkan ini ke sources.list.

deb http://IP_Anda/iso1/ feisty main restricted
deb http://IP_Anda/iso2/ feisty universe
deb http://IP_Anda/iso3/ feisty universe
deb http://IP_Anda/iso4/ feisty universe multiverse

NB: Main, restricted, universe, multiverse tergantung dari file repo.

Lalu, fetch updates.
$ sudo apt-get update

3. Adept dan Synaptic itu keren
Kini Anda sudah siap mengambil paket dari ISO sendiri. Bahkan Aa, teteh, Abah, adek, tetangga juga bisa menikmati. Tinggal colokin kabel LAN atau pake wireless switch (biar terlihat canggih, modern, elegan, bonafid, haibat dan bermartabat), terus sources.list-nya diedit sesuai petuah di atas, dan voila…

Mohon tanggapan kalau ada yang salah ya, Om?

Why i change generic kernel to server kernel

a couple week ago i install new ubuntu 8.04 betha1 to my SUN Fire server, but i don't care what the kernel is. so i have to change it after read this article



http://www.enterprisenetworkingplanet.com/netos/article.php/3710641


Ubuntu Server: Considering Kernel Configuration
November 12, 2007
By Carla Schroder

Carla Schroder
Last week we looked at Ubuntu Server's documentation, discussed hardware requirements, tried to figure out what sets Ubuntu Server apart from Ubuntu Desktop, and what's included in the current release, 7.10 (Gutsy Gibbon). Ubuntu itself is not very helpful with these things, and I don't like to write reviews that complain without also offering some answers, so today we're going to learn how to dig into Ubuntu without installing it and find out these things for ourselves. We still need the installation .iso image, but at least we won't have to install it or even burn it to a CD to learn some useful information.

We're taking such a deep dive into the very bowels of Ubuntu Server that this is expanding into a three-parter, so hold on to your hats and enjoy the ride.

What Is a "Server" Kernel?

We're going to compare the /boot/config-2.6.22-14-server and /boot/config-2.6.22-14-generic files and find out exactly what Ubuntu thinks a server kernel is, and what a desktop kernel is. We'll do this by mounting the installation .iso in a temporary directory, and then extract and compare the two files:

# mkdir temp
# mount -o loop ubuntu-7.10-server-i386.iso
# cd temp
# find temp -name linux-image*
temp/pool/main/l/linux-meta/linux-image-generic_
2.6.22.14.21_i386.deb
temp/pool/main/l/linux-meta/linux-image-server_
2.6.22.14.21_i386.deb
temp/pool/main/l/linux-source-2.6.22/linux-image-
2.6.22-14-generic_2.6.22-14.46_i386.deb
temp/pool/main/l/linux-source-2.6.22/linux-image-
2.6.22-14-server_2.6.22-14.46_i386.deb

Check it out, we get both desktop and server kernels in one location, so this is going to be easy. We want the last two, as those are the real kernel packages, which the linux-meta packages are not. Copy them into separate directories for unpacking. .deb packages are special archives that contain ordinary tar archives, and these two packages contain files with the same names: control.tar.gz, data.tar.bz2, and debian-binary. So you can't unpack them in the same directory.

Use the ar and tar commands to unpack the .debs, and then to unpack their data.tar.gz files:

# ar -x linux-image-2.6.22-14-server_2.6.22-14.46_i386.deb
# tar jxvf data.tar.bz2

Now you can pluck out the boot/config-2.6.22-14-server and boot/config-2.6.22-14-generic files, copy them into the same directory for convenience, and diff them:

# diff --suppress-common-lines -y config-2.6.22-14-server config-2.6.22-14-generic

This gives us some nice manageable output — around 50 lines, rather than ~3100 lines per file. So let's take a look at diff's output to see what's different.

I/O Scheduler

There are four different types of I/O scheduling: CFQ (Completely Fair Queuing), Deadline, NOOP, and Anticipatory. Ubuntu makes CFQ the default for desktop kernels, and Deadline for server kernels. The goal is the same for all of them: to optimize hard disk bandwidth for different classes of workloads. In your configuration file this is the CONFIG_DEFAULT_IOSCHED option, plus the CONFIG_IOSCHED_CFQ, _DEADLINE, _AS, and _NOOP options.

  • CFQ tries to balance all read/write requests equally.
  • Deadline gives a higher priority to read requests, and will re-order read/write requests aggressively to meet the goal of completing read requests within a specified time, without "starving" write requests, which are not given deadlines.
  • Anticipatory aims to reduce latency by giving priority to already-running applications. It is supposed to be suitable for smaller systems with one or two hard disks, and single or dual-core CPUs.
  • NOOP is a minimal scheduler for systems with hardware that handles I/O scheduling, like large SCSI RAID arrays.

The question of which one is appropriate depends on your systems and how you use them: how many CPUs, how many hard disks and controllers, what types of applications, and the loads your systems have to handle. You can run benchmarks, and then tune your systems accordingly. You can pass scheduler options in as boot-time options, or you can even enable different schedulers per block device and change them on-the-fly (see Resources). The Ubuntu defaults are good starting points, and if you need to tweak the settings they're just as tweakable as on any Linux.

Preemption

The server kernel has kernel preemption turned off (CONFIG_PREEMPT_NONE=y), while the desktop kernel has it enabled (CONFIG_PREEMPT_BKL=y, CONFIG_PREEMPT_VOLUNTARY=y). Preemption works along with scheduling to fine-tune performance, efficiency, and responsiveness. In non-preemptive kernels, kernel code runs until completion; the scheduler can't touch it until it's finished. But the Linux kernel allows tasks to be interrupted at nearly any point (but not when it is unsafe, which is a whole huge fascinating topic all by itself), so that tasks of lesser-priority can jump to the head of the line.

This is appropriate for desktop systems because users typically have several things going at once: writing documents, playing music, Web surfing, downloading, and so on. Users don't care how responsive background applications are, but only the ones they're actively using; so if loading a Web page takes a little longer while the user is writing an email, it's an acceptable trade-off. Overall efficiency and performance are actually reduced, but not in a way that annoys the user.

On servers you want to minimize any and all performance hits, so turning off preemption is usually the best practice.

Memory

The 32-bit server kernel supports up to 64 GB of memory; the desktop kernel, a mere 4 GB (CONFIG_HIGHMEM64G=y, CONFIG_HIGHMEM4G=y). You'll only see these options in 32-bit kernels because the 32-bit address space is big enough to support only 4 GB without trickery. Or by using the Intel PAE (Physical Address Extension) mode, if you want to get technical. Linux supports PAE, and you also need PAE support in your CPU. Anything newer than a Pentium Pro or AMD K6-3 should be fine. On a 64-bit system you won't see any memory options because it doesn't need hacks to overcome a lack of memory addressing space; you should be fine until your needs exceed 16 exabytes of RAM.

Ticks and HZ

Both kernels support on-demand interrupt timers (CONFIG_NO_HZ=y), or the so-called "tickless" option. This means that during periods of no activity, the system goes into a truly idle state, which is supposed to save on power and cooling.

The server kernel is set to a timer interrupt rate of 100 Hz (CONFIG_HZ=100, CONFIG_HZ_100=y), which means it accepts 100 interrupts per second. Another way to think of this is the kernel looks up and peers around 100 times per second for something to do. The desktop kernel is set to 250 Hz; lower numbers = lower overhead and higher latency, higher numbers = higher overhead and lower latency. Higher numbers generally mean the system feels more responsive, at the price of higher CPU usage. Some processes require more interrupts; for example, video processing and VoIP servers need 1000 Hz. If you need to change the Hz value it requires a kernel re-compile.

Come back next week to complete our kernel comparisons, and to finish our deep dive into the guts of Ubuntu Server.


HOWTO: Setup Samba peer-to-peer with Windows

this site was help me while I'm in injury time to transfer file from my testing server

http://ubuntuforums.org/showthread.php?t=202605



HOWTO: Setup Samba peer-to-peer with Windows


As many fellow Ubuntu users seem to have trouble setting up samba peer-to-peer with Windows I decided to write a small howto on this matter.

NOTE: I am aware that there's a wiki-page as well as several other howto's around - but by looking at the constant "how do I setup samba" posts that are floating around in the forum I simply see the need for a more thourough guide on this matter.

Feel free to contribute and suggest - it'll only help to make this howto a better guide.

The goal of this howto is to have samba act like a Windows Workstation in the LAN. As a "value added bonus" we will use samba to do netbios name resolution so that you can use the names of the workstations for network drive mapping instead of their ip-addresses (i.e.: \MY_WINDOWS_BOX\SHARE) - but only for as long as your Linux box has an static ip-address and is up and running.

This guide is based on Ubuntu 6.06 LTS and intended for all architectures (i386, AMD64, ...) - if you are still using Breezy it's safe to follow this guide as there should be no differencies.

A second guide on how to setup samba as Primary Domain Controller along with several other services such as DHCP, DNS and NTP will follow later on as this topic will be a little more thourough.


1. Prerequisites

- Your Linux box should have an static ip-address.
In case you're getting your ip from a router/server via DHCP make sure it's configured to provide a fixed dhcp-lease. If that's no valid option you cannot use WINS ... more on this way down.

- You need to have samba installed.
If you haven't done so already open a terminal and type:

Code:
sudo apt-get install samba
Don't close the terminal upon installation - we still need the commandline to get several tasks done!


2. Getting samba configured

First, let us make sure samba isn't running:

Code:
sudo /etc/init.d/samba stop
As a starting point I included an smb.conf below, and there are only a few simple things you may need to tweak.

Since the installation of samba just installed a rather useless template file we're going to rename it - we keep the file just in case.

Code:
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.template
Next we create a new empty file

Code:
sudo touch /etc/samba/smb.conf
And finally we need to open the file inside an editor

Code:
sudo gedit /etc/samba/smb.conf
NOTE: If you're on KDE replace "gedit" with "kate"

Copy / Paste the contents of the code-section below into your editor and read on ...

Code:
[global]
; General server settings
netbios name = YOUR_HOSTNAME
server string =
workgroup = YOUR_WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

passdb backend = tdbsam
security = user
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast

wins support = yes

printing = CUPS
printcap name = CUPS

syslog = 1
syslog only = yes

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[print$]
path = /var/lib/samba/printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0664
directory mask = 0775

[printers]
path = /tmp
printable = yes
guest ok = yes
browseable = no

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /media/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
Ok, I already mentioned that there are a few simple things you may need to tweak; so here they are:

-> netbios name = YOUR_HOSTNAME

Replace "YOUR_HOSTNAME" with your desired hostname (don't use spaces!). Best pratice would be to use the same name you configured upon installation.

Example:

netbios name = DAPPER

-> workgroup = YOUR_WORKGROUP

Replace "YOUR_WORKGROUP" with the name of your workgroup, but make sure you're using the same as configured in Windows.

To find out the Workgroup name in Windows follow these steps:

- Click "START"
- Click "Control Panel"
- Click "System"
- Click the 2nd Tab entitled "Computername" and find the name of the Workgroup there.

Example:

workgroup = MSHOME

-> wins support = yes

If your box doesn't have a static ip-address, or you cannot configure your router/server to provide you with a fixed dhcp-lease, change this configuration parameter to "no".

In this case you cannot use the benefits of WINS.

-> [MyFiles]

This is the name of the share. Leave it as it is or adjust it to whatever you prefer. Don't use more than 31 characters and try to avoid spaces!

-> path = /media/samba/

This suggests that you've mounted an hard drive or partition on /media/samba where all the shared files will be stored.

In case you don't have an extra hard drive/partition you may also create folder.

I assume you've been wise enough to put /home onto a separate partition having an reasonable amount of storage space.

To create the folder type (inside a new terminal) ...

Code:
sudo mkdir /home/samba
... and adjust "path =" to read ...

path = /home/samba/

Remember that this is just an example - you are free to put things wherever you like.

-> force user = YOUR_USERNAME
-> force group = YOUR_USERNAME

Well, this should say it all. Replace "YOUR_USERNAME" with the name you use for login (no spaces!).

Example:

force user = stormbringer
force group = stormbringer

Now we completed the part of editing smb.conf

Save the file and close gedit.

Since we are going to share the folder with other users we should now make sure that the permissions are set. Type:

Code:
sudo chmod 0777 /media/samba
NOTE: Don't forget to correct the path to the location you chose above!

That's it - now we need to start samba ...


1.1 Starting samba and setting up user accounts

Let us fire up samba for the first time. Type:

Code:
sudo /etc/init.d/samba start
There shouldn't be any errors - if you are presented with an error message make sure everything is correct (search for typos and/or invalid paths).

Time to add yourself as an samba user.

NOTE: You will be asked for a password - make sure you use the same as you use for login!

Code:
sudo smbpasswd -L -a your_username
sudo smbpasswd -L -e your_username
In case you need other users to be able to access the share you need to add them to your system AND samba as well. Make sure you use the very same Windows usernames and passwords!

NOTE: Windows XP doesn't set passwords for its useraccount per default. If you haven't set a password on your XP box just press enter when prompted to enter a password for the user account you're about to create!

In the following example we will add an user called "mark" ...

Example:

Code:
sudo useradd -s /bin/true mark
sudo smbpasswd -L -a mark
sudo smbpasswd -L -e mark
The "-s /bin/true" in the first line prevents the users from being able to access the commandline of your linux box ("-s" stands for "shell"). I strongly advise you to follow this recommendation! Don't change that setting to a valid login-shell unless you really know what you are doing!

Repeat this step until you configured all user accounts!

Now that we configured samba and created the user accounts we are done with the Linux-part - there's one more thing to do in Windows.


2. Changing network settings in Windows

Now we should let Windows know that there's a WINS server active in the network.

If you had to change "wins support" to "no" above skip this step!

- Click "START"
- Click "Control Panel"
- Click "Network Connections"
- Find your "LAN Connection"
- Right-click the icon and select "Properties"
- Select the "TCP/IP" Protocol and click the "Properties" button
- Click "Advanced"
- Select the third Tab entitled "WINS"
- Click "Add"
- Type in the ip-address of your Linux box
- Click "Add"
- Select "Use NetBIOS over TCP/IP"
- Click "OK"
- Click "OK"
- Click "OK"
- Reboot Windows

Upon reboot you may now map the network drive within Windows.

With WINS enabled:
- Click "START"
- Right-click "My Computer"
- Select "Map network drive"
- Choose the drive letter
- Type \\DAPPER\MyFiles
NOTE: Adjust this to the hostname and sharename you chose above!
- Click "Finish"

With WINS disabled:
- Click "START"
- Right-click "My Computer"
- Select "Map network drive"
- Choose the drive letter
- Type \\\MyFiles
NOTE: To find out the ip-address of your Linux box type "ifconfig" inside a terminal and find the ip for the correct interface (i.e. eth0). Don't forget to adjust the sharename to the name you chose above.
- Click "Finish"

That's it - samba is up and running now.


3. Security consideration

This is the right time to think about security right away.

In case your computer has more than one network connection (i.e. wired and wireless ethernet) you may want to restrict access to samba.

If not especially configured samba will bind its service to all available network interfaces.

So, let us assume you only want your wired network to have access and that the network card is called eth0.

Add the following lines to the [general] section of your smb.conf to achieve that goal:

Code:
interfaces = lo, eth0
bind interfaces only = true
If you did it correctly it should look similar to this:

Code:
[global]
; General server settings
netbios name = YOUR_HOSTNAME
server string =
workgroup = YOUR_WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
interfaces = lo, eth0
bind interfaces only = true
Now only the local loopback interface (dubbed "lo") and eth0 are able to access samba - there's no need to fear that someone might break into your system by wireless as the interface isn't bound to the service.


4. Final words

If you happen to have any questions feel free to ask - I'll try to help as soon as possible.

If you find any mistakes in this howto please let me know so that I can fix them.

Feel free to contribute and suggest - help to make this howto a better guide.


5. Addendum: Useful links

Here are some links you may find useful.

The onsite links refer to other samba-guides and to ubuntu_daemon's "Important Links" thread.

- Onsite
Ubuntu Help: Windows Networkworking
Ubuntu Documentation: Setting up Samba

READ THIS FIRST prior to posting - IMPORTANT links (by ubuntu_daemon)


The offsite links refer to the offical Samba homepage and to a selected choice of their official documentation; these links are useful if you like to dig yourself into the mysteries of samba's configuration and usage as well as troubleshooting problems.

Hotspot with Mikrotik

it was help me while dig thousand hotspot reffence

taken from http://pujianto.wordpress.com/2007/07/12/hotspot/

Hotspot

Ditulis oleh pujianto di/pada 12 Juli, 2007

Misal 125.126.127.128 IP Publik dari ISP dan lokal 192.168.1.0/24
=> ether1 ke ISP
=> ether2 ke lokal

#Setting IP
[malih@Mikrotik]>ip address add address=125.126.127.128/27 interface=ether1
[malih@Mikrotik]>ip address add address=192.168.1.0/24 interface=ether2

#Setting Gateway (menuju ISP)
[malih@Mikrotik]>ip route add gateway=20.30.40.50

#setting DNS
[malih@Mikrotik]>ip dns set primary-dns=20.30.40.50 allow-remote-requests=yes
[malih@Mikrotik]>ip dns set secondary-dns=21.31.41.51 allow-remote-requests=yes

#NAT (untuk forward lokal ke public)
[malih@Mikrotik]>ip firewall nat add chain=srcnat action=masquerade out-interface=ether1

# Setting DHCP
[malih@Mikrotik]>ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=20.30.40.50,21.31.41.51

#Distribusikan DHCP
[malih@Mikrotik]>ip pool add name=dhcp-pool ranges=192.168.1.100-192.168.1.254

#Tambahkan DHCP server
[malih@Mikrotik]>ip dhcp-server add name=zamrud disabled=no interface=ether2 address-pool=dhcp-pool

#Set Hotspot
[malih@Mikrotik] > ip hotspot setup
hotspot interface: ether2
local address of network: 192.168.1.1/24
masquerade network: yes
address pool of network: 192.168.1.100-192.168.1.254
select certificate: none
ip address of smtp server: 0.0.0.0
dns servers: 20.30.40.50,21.31.41.51

#Dengan Winbox
IP| hotspot
kemudian pada tabulasi servers click setup

hotspot interface: ether2
local address of network: 192.168.1.1/24
masquerade network: yes
address pool of network: 192.168.1.100-192.168.1.254
select certificate: none
ip address of smtp server: 0.0.0.0
dns servers: 20.30.40.50,21.31.41.51

#Create user
click tabulasi users trus click tanda plus…. kemudian isikan sesuai akses yg akan diberikan ke user
hotspot profile akan terbentuk secara default pada saat create hotspot server,edit sesuai kebutuhan

#Edit Login Hotspot
Masuk FTP Hotspot Server dan ubah sesuai keperluan file HTML di folder hotspot

Changing the DATE or TIME on a LINUX box

taken from http://yellowpad.info/linux/date_time.asp

Changing the DATE or TIME on a LINUX box

I discovered the time was off by a number of minutes on one of my servers. The server in question manages website hosting using Ensim WEBppliance Pro 3.5.10 on a Red Hat Linux 7.3 system. To say I am far less familiar with Linux than with windows would be an understatement.

The set of instructions below worked quickly and easily for me from the bash (command) prompt on my Linux machines running:

Red Hat Linux
release 5.2
(Apollo)
Kernel 2.0.36
on an i486

and

Red Hat Linux
release 7.3
(Valhalla)
Kernel 2.4.20-20.7
on an i586

Under most configurations, you must be logged on as "root" to make this change. You can log on locally (physically at the Linux box) as root. However, if you must perform this remotely (over a network or the Internet), you need to first log on to the machine under a user that will allow you to log on remotely. Then "switch user" to "root" by typing "su" at the prompt and pressing enter. When prompted, type root's password and press enter.

To change the time from the bash prompt, as root, use the "date" command. Typing "date" by itself will return the date, time, and year. Typing "date MMDDhhmmCCYY" will allow you to set any part of the date or time.

Linux Examples:

Login to Linux box as root and enter root's password:

[me@mybox me]$ su
password:

Check the current date and time of the Linux box by entering:

[root@mybox me]# date
Linux yields the current settings:
[root@mybox me]# Wed Apr 7 12:03:45 EDT 2004

Change the current time and date of the Linux box by entering:
[root@mybox me]# date 040713032004
would change the time and yield:
[root@mybox me]$ Wed Apr 7 13:03:00 EDT 2004

create own Ubuntu repository from ISO image DVD/CD


taken from : http://sugengfiles.wordpress.com/2007/07/23/how-to-repositori-local-menggunakan-iso-dvd-ubuntu/

[How To] Repositori Local Menggunakan ISO DVD Ubuntu

Akhirnya setelah lama menunggu sampai juga pesanan ISO DVD Repositori Ubuntu, namun saya tidak memesan DVD tapi minta tolong teman saya yang di UI untuk numpang mendownload 4 ISO DVD Repositori Ubuntu Feisty. Thank’s to Fajar (anak ekonomi yang hobi ngoprek komputer). Dari HD eksternal miliknya saya copykan 3 ISO DVD tersebut ke hardisk komputer saya. Kenapa 3?? Karena yang satu sudah sekalian dia bakar ke dalam DVD. Namun karena sedikit bermasalah dengan keping DVD-nya hanya 1 DVD yang berhasil dibakar.

Padahal saya sudah tidak tahan lagi untuk mencoba DVD repo tersebut di komputer desktop rumah saya (di laptop sudah diinstall ubuntu dan menggunakan repo dari kambing). Karena komputer rumah tidak bisa mengakses internet dan LAN cardnya pun sudah rusak padahal ingin sekali pakai Ubuntu dirumah (sebelumnya pakai dual OS wind**s dan Zendwalk).

Jadi bagaimana?? Setelah buka-buka koleksi majalah Infolinux ada satu artikel tentang membuat repositori local ubuntu. Namun di artikel tersebut tidak membahas membuat repo lokal dari file ISO. Namun dari artikel tersebut sedikit memberikan pencerahan buat saya.

Pertama yang saya lakukan adalah memounting partisi hardisk tempat ISO DVD berada. Jika partisi sudah terbaca ketika start up ubuntu kita tidak perlu lagi memounting partisi tersebut. Sesudah itu saya membuat folder di /mnt sebagai tempat memounting file ISO DVD. Karena saya memiliki 3 ISO file jadi saya membuat 3 folder. Anggap saja nama folder tersebut adalah iso1, iso2 dan iso3.

sudo mkdir -p /mnt/iso1

sudo mkdir -p /mnt/iso2

sudo mkdir -p /mnt/iso3

Setelah folder dibuat yang saya lakukan selanjutnya adalah memounting file ISO tersebut ke masing-masing folder tersebut.

sudo mount -o loop /media/hda6/ubuntu_repositori/ubuntu-7.04-repository-i386-2-contrib.iso /mnt/iso1

sudo mount -o loop /media/hda6/ubuntu_repositori/ubuntu-7.04-repository-i386-3-contrib.iso /mnt/iso2

sudo mount -o loop /media/hda6/ubuntu_repositori/ubuntu-7.04-repository-i386-4-contrib.iso /mnt/iso3

Setelah ketiga ISO sudah berhasil di mount berikutnya tambahkan path di file sources.list

sudo gedit /etc/apt/sources.list

Lalu tambahkan path

deb file:/mnt/iso1 feisty universe

deb file:/mnt/iso2 feisty universe

deb file:/mnt/iso3 feisty universe multiverse

Untuk repo yang sudah dibakar saya tinggal masukkan DVD tersebut dan tambahkan otomatis.

Jika proses penambahan path repo sudah selesai, save file sources.list lakukan apt-get update.

sudo apt-get update

Sip jika tidak ada kesalahan maka sekarang kita sudah bisa menginstall software dari repositori lokal kita.

Sayangnya tiap kali menginstall kita harus memounting masing-masing file ISO, untuk itu saya membuat script bash yang saya panggil t

Adding New User On Mysql

last week ago i got difficulties to submit new database user in my mysql-server, finaly i found this website

http://dev.mysql.com/doc/refman/5.0/en/adding-users.html

5.5.2. Adding New User Accounts to MySQL

You can create MySQL accounts in two ways:

  • By using statements intended for creating accounts, such as CREATE USER or GRANT

  • By manipulating the MySQL grant tables directly with statements such as INSERT, UPDATE, or DELETE

The preferred method is to use account-creation statements because they are more concise and less error-prone. CREATE USER and GRANT are described in Section 11.5.1.1, “CREATE USER Syntax”, and Section 11.5.1.3, “GRANT Syntax”.

Another option for creating accounts is to use one of several available third-party programs that offer capabilities for MySQL account administration. phpMyAdmin is one such program.

The following examples show how to use the mysql client program to set up new users. These examples assume that privileges are set up according to the defaults described in Section 2.4.16.3, “Securing the Initial MySQL Accounts”. This means that to make changes, you must connect to the MySQL server as the MySQL root user, and the root account must have the INSERT privilege for the mysql database and the RELOAD administrative privilege.

As noted in the examples where appropriate, some of the statements will fail if you have the server's SQL mode has been set to enable certain restrictions. In particular, strict mode (STRICT_TRANS_TABLES, STRICT_ALL_TABLES) and NO_AUTO_CREATE_USER will prevent the server from accepting some of the statements. Workarounds are indicated for these cases. For more information about SQL modes and their effect on grant table manipulation, see Section 5.1.6, “SQL Modes”, and Section 11.5.1.3, “GRANT Syntax”.

First, use the mysql program to connect to the server as the MySQL root user:

shell> mysql --user=root mysql 

If you have assigned a password to the root account, you'll also need to supply a --password or -p option for this mysql command and also for those later in this section.

After connecting to the server as root, you can add new accounts. The following statements use GRANT to set up four new accounts:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost';

The accounts created by these GRANT statements have the following properties:

  • Two of the accounts have a username of monty and a password of some_pass. Both accounts are superuser accounts with full privileges to do anything. One account ('monty'@'localhost') can be used only when connecting from the local host. The other ('monty'@'%') can be used to connect from any other host. Note that it is necessary to have both accounts for monty to be able to connect from anywhere as monty. Without the localhost account, the anonymous-user account for localhost that is created by mysql_install_db would take precedence when monty connects from the local host. As a result, monty would be treated as an anonymous user. The reason for this is that the anonymous-user account has a more specific Host column value than the 'monty'@'%' account and thus comes earlier in the user table sort order. (user table sorting is discussed in Section 5.4.5, “Access Control, Stage 1: Connection Verification”.)

  • One account has a username of admin and no password. This account can be used only by connecting from the local host. It is granted the RELOAD and PROCESS administrative privileges. These privileges allow the admin user to execute the mysqladmin reload, mysqladmin refresh, and mysqladmin flush-xxx commands, as well as mysqladmin processlist . No privileges are granted for accessing any databases. You could add such privileges later by issuing additional GRANT statements.

  • One account has a username of dummy and no password. This account can be used only by connecting from the local host. No privileges are granted. The USAGE privilege in the GRANT statement enables you to create an account without giving it any privileges. It has the effect of setting all the global privileges to 'N'. It is assumed that you will grant specific privileges to the account later.

  • The statements that create accounts with no password will fail if the NO_AUTO_CREATE_USER SQL mode is enabled. To deal with this, use an IDENTIFIED BY clause that specifies a non-empty password.

As an alternative to GRANT, you can create the same accounts directly by issuing INSERT statements and then telling the server to reload the grant tables using FLUSH PRIVILEGES:

shell> mysql --user=root mysql
mysql> INSERT INTO user
-> VALUES('localhost','monty',PASSWORD('some_pass'),
-> 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
mysql> INSERT INTO user
-> VALUES('%','monty',PASSWORD('some_pass'),
-> 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',
-> 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',
-> '','','','',0,0,0,0);
mysql> INSERT INTO user SET Host='localhost',User='admin',
-> Reload_priv='Y', Process_priv='Y';
mysql> INSERT INTO user (Host,User,Password)
-> VALUES('localhost','dummy','');
mysql> FLUSH PRIVILEGES;

The reason for using FLUSH PRIVILEGES when you create accounts with INSERT is to tell the server to re-read the grant tables. Otherwise, the changes go unnoticed until you restart the server. With GRANT, FLUSH PRIVILEGES is unnecessary.

The reason for using the PASSWORD() function with INSERT is to encrypt the password. The GRANT statement encrypts the password for you, so PASSWORD() is unnecessary.

The 'Y' values enable privileges for the accounts. Depending on your MySQL version, you may have to use a different number of 'Y' values in the first two INSERT statements. For the admin account, you may also employ the more readable extended INSERT syntax using SET.

In the INSERT statement for the dummy account, only the Host, User, and Password columns in the user table row are assigned values. None of the privilege columns are set explicitly, so MySQL assigns them all the default value of 'N'. This is equivalent to what GRANT USAGE does.

If strict SQL mode is enabled, all columns that have no default value must have a value specified. In this case, INSERT statements must explicitly specify values for the ssl_cipher, x509_issuer, and x509_subject columns.

Note that to set up a superuser account, it is necessary only to create a user table entry with the privilege columns set to 'Y'. user table privileges are global, so no entries in any of the other grant tables are needed.

The next examples create three accounts and give them access to specific databases. Each of them has a username of custom and password of obscure.

To create the accounts with GRANT, use the following statements:

shell> mysql --user=root mysql
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON bankaccount.*
-> TO 'custom'@'localhost'
-> IDENTIFIED BY 'obscure';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON expenses.*
-> TO 'custom'@'whitehouse.gov'
-> IDENTIFIED BY 'obscure';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON customer.*
-> TO 'custom'@'server.domain'
-> IDENTIFIED BY 'obscure';

The three accounts can be used as follows:

  • The first account can access the bankaccount database, but only from the local host.

  • The second account can access the expenses database, but only from the host whitehouse.gov.

  • The third account can access the customer database, but only from the host server.domain.

To set up the custom accounts without GRANT, use INSERT statements as follows to modify the grant tables directly:

shell> mysql --user=root mysql
mysql> INSERT INTO user (Host,User,Password)
-> VALUES('localhost','custom',PASSWORD('obscure'));
mysql> INSERT INTO user (Host,User,Password)
-> VALUES('whitehouse.gov','custom',PASSWORD('obscure'));
mysql> INSERT INTO user (Host,User,Password)
-> VALUES('server.domain','custom',PASSWORD('obscure'));
mysql> INSERT INTO db
-> (Host,Db,User,Select_priv,Insert_priv,
-> Update_priv,Delete_priv,Create_priv,Drop_priv)
-> VALUES('localhost','bankaccount','custom',
-> 'Y','Y','Y','Y','Y','Y');
mysql> INSERT INTO db
-> (Host,Db,User,Select_priv,Insert_priv,
-> Update_priv,Delete_priv,Create_priv,Drop_priv)
-> VALUES('whitehouse.gov','expenses','custom',
-> 'Y','Y','Y','Y','Y','Y');
mysql> INSERT INTO db
-> (Host,Db,User,Select_priv,Insert_priv,
-> Update_priv,Delete_priv,Create_priv,Drop_priv)
-> VALUES('server.domain','customer','custom',
-> 'Y','Y','Y','Y','Y','Y');
mysql> FLUSH PRIVILEGES;

The first three INSERT statements add user table entries that allow the user custom to connect from the various hosts with the given password, but grant no global privileges (all privileges are set to the default value of 'N'). The next three INSERT statements add db table entries that grant privileges to custom for the bankaccount, expenses, and customer databases, but only when accessed from the proper hosts. As usual when you modify the grant tables directly, you must tell the server to reload them with FLUSH PRIVILEGES so that the privilege changes take effect.

If you want to give a specific user access from all machines in a given domain (for example, mydomain.com), you can issue a GRANT statement that uses the “%” wildcard character in the host part of the account name:

mysql> GRANT ...
-> ON *.*
-> TO 'myname'@'%.mydomain.com'
-> IDENTIFIED BY 'mypass';

To do the same thing by modifying the grant tables directly, do this:

mysql> INSERT INTO user (Host,User,Password,...)
-> VALUES('%.mydomain.com','myname',PASSWORD('mypass'),...);
mysql> FLUSH PRIVILEGES;