Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

2022-01-28

Tiny Core Linux - sftp

 

/usr/local/etc/ssh/sshd_config

Match User ftp1

        ChrootDirectory /ftp

        X11Forwarding no

        AllowTcpForwarding no

        ForceCommand internal-sftp 


/etc/passwd
ftp1:x:1000:1000:Linux User,,,:/upload:/bin/false


drwxr-xr-x 3 root root 60 Jan 28 11:02 /ftp
drwxrwxr-x 2 root ftp1 60 Jan 28 11:03 /ftp/upload


2020-07-23

Tiny Core Linux UTF-8 support

getlocale.tcz - load to re-config locale with en_US.UTF-8 & gen mylocale.tcz

mylocale.tcz

add boot command:
    lang=en_US.UTF-8


.profile:
export LC_CTYPE=en_US.UTF-8
Fix google chrome chinese support
export G_FILENAME_ENCODING=UTF-8


* Fix gnome-terminal crash
 # Locale not supported by C library.
        Using the fallback 'C' locale.
 # Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal:  GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 9

Error constructing proxy for org.gnome.Terminal: /org/gnome/Terminal/Factory0: 
Error calling StartServiceByName for org.gnome.Terminal:
GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: 
Process /usr/lib/gnome-terminal/gnome-terminal-server exited with status 8

2019-03-26

GRUB2 multiboot ISO 2018


GRUB2 multiboot ISO (2014)


Linux ISO default


Arch Linux  2019.01.01


Cent OS  7 1810


clonezilla 2.5.6-22



Debian 9.6.0


FreeBSD 12.0


Fedora 29-1.2


Gentoo 20160704


Kali 2018.4


Knoppix V8.2-2018-05-10


kubuntu 18.10


Linuxmint 19.1


LMDE 3-201808


lubuntu 18.10


NST 28-10439


Pentoo 2018.0_RC8


openSUSE 15.0


slitaz 2019.01.06


Ubuntu 18.10


UbuntuStudio 18.10


Win10 (partition NOT ISO)

2014-04-02

tiny core linux Oracle XE 11R2


SWAP=/mnt/sda1/tmp/swap
MEM=1G

####################################
# load util

st2 glib2 make gcc libaio binutils net-tools
st2 bash sed
st2 bzip2-lib
sudo ln -s /usr/local/lib/libbz2.so /usr/local/lib/libbz2.so.1
sudo ln -s /usr/bin/awk /bin


####################################
# add lib path

sudo ln -s /lib /lib64
#sudo ln -s /usr/local/lib /usr/local/lib64
#sudo ln -s /usr/lib /usr/lib64
#sudo ln -s /var/lib /var/lib64

#echo /u01/app/oracle/product/11.2.0/xe/lib | sudo tee -a /etc/ld.so.conf
#sudo ldconfig


####################################
# Create User oracle:dba

sudo addgroup dba
sudo adduser -D oracle -G dba

sudo passwd -d oracle

echo "
ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe

LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib:\$ORACLE_HOME/lib
export LD_LIBRARY_PATH

PATH=\$PATH:/usr/local/bin
export PATH

. $ORACLE_HOME/bin/oracle_env.sh
" | sudo tee -a /home/oracle/.ashrc


####################################
#  install RPM

sudo rpm -i Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm


####################################
#  Create Folder ??

sudo mkdir -p /var/lock/subsys
#sudo mkdir -p /u01/app/oracle/oradata
#sudo mkdir -p /u01/app/oracle/diag
sudo mkdir -p /u01/app/oracle/product/11.2.0/xe/config/log
sudo mkdir -p /u01/app/oracle/product/11.2.0/xe/config/seeddb


####################################
# fix script executable

sudo chmod a+x /u01/app/oracle/product/11.2.0/xe/config/scripts/*.sh
sudo chmod a+x /etc/init.d/oracle-xe

sudo ln -s /u01/app/oracle/product/11.2.0/xe/lib/libagtsh.so.1.0 /u01/app/oracle/product/11.2.0/xe/lib/libagtsh.so


####################################
# change owner to oracle:dba

sudo chown -R oracle:dba /u01


####################################
# set memory

sudo sed -i -e "s/%memory_target%/${MEM}/" /u01/app/oracle/product/11.2.0/xe/config/scripts/init.ora
sudo sed -i -e "s/%memory_target%/${MEM}/" /u01/app/oracle/product/11.2.0/xe/config/scripts/initXETemp.ora


####################################
# set swap

#mkswap $SWAP
sudo swapon $SWAP


####################################
# change kernel setting

echo "250 32000 100 128" | sudo tee /proc/sys/kernel/sem
echo "4294967295" |sudo tee /proc/sys/kernel/shmmax
echo "4096" | sudo tee /proc/sys/kernel/shmmni
echo "2097152" | sudo tee /proc/sys/kernel/shmall
echo "6815744" | sudo tee /proc/sys/fs/file-max
echo "9000 65500" | sudo tee /proc/sys/net/ipv4/ip_local_port_range

cat /proc/sys/kernel/sem \
/proc/sys/kernel/shmmax \
/proc/sys/kernel/shmmni \
/proc/sys/kernel/shmall \
/proc/sys/fs/file-max \
/proc/sys/net/ipv4/ip_local_port_range


####################################
# configure oracle

sudo /etc/init.d/oracle-xe status

sudo /etc/init.d/oracle-xe configure

sudo /etc/init.d/oracle-xe status

# sudo /etc/init.d/oracle-xe start


####################################
# login

# sqlplus system


####################################
# set for remote login

# SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

2014-03-18

Boot Disk


diskpart
list disk
select disk ?
clean
create partition primary
select partition 1
active
format fs=ntfs quick label=”Win8-RP-x64”
  -- OR -- FS=FAT32
exit

(g: windows 8 DVD)
C:\Windows\system32>g:
G:\>cd boot
  Run "bootsect /help" for detailed usage instructions.

G:\boot>bootsect /nt60 e:
   Target volumes will be updated with BOOTMGR compatible bootcode.
   Bootcode was successfully updated on all targeted volumes.
G:\boot>exit

xcopy g:\*.* e:\ /E /H /F

-----------------------

bcd
bcdedit
bootcfg
fixboot
fixmbr
bootsect


=========================

fdisk
fdisk /mbr
format [/s]
sys

=========================

fdisk
mkfs.ext4

=========================

2014-03-17

GRUB2 multiboot ISO


GRUB2 multiboot ISO 2018 update

USB:
/boot/grub
/boot/iso
/boot/image
/boot/tc4
/boot/tc5
/boot/syslinux

get USB UUID & Label:
> blkid



/boot/grub.sh


/boot/grub/grub.env (1024byte)


/boot/grub/grub.cfg




/boo/grub/grub_hd.cfg (Harddisk)


/boo/grub/grub_fd.cfg (Floppy)



/boo/grub/grub_pe.cfg (Windows PE)

Linux:

/boo/grub/grub_tci.cfg (Tiny Core Linux)

/boo/grub/grub_sl.cfg (Slax)

/boo/grub/grub_u.cfg (Ubuntu)


/boo/grub/grub_d.cfg (Debian)


/boo/grub/grub_cd.cfg (CDLinux)


/boo/grub/grub_cr.cfg (ChromeOS)


/boo/grub/grub_s.cfg (openSUSE)


/boo/grub/grub_ce.cfg (CentOS)
* rdshell
method 1:
set rootopt="root=live:LABEL=CentOS-${ver}-${bit}-${live}"

boot into rdshell

1a: boot from RAM
# mkdir 1 2
# mount /dev/<usb partition> 1
# cp 1/boot/iso/<Centos ISO> 2
# umount 1
  (remove USB)
# exit

1b: boot from USB
# mkdir 1 2
# mount /dev/<usb partition> 1
# mount -o loop 1/boot/iso/<Centos ISO> 2
# exit

method 2:
set rootopt="root=live:${ISO_Path}/${iso}"

boot into rdshell

2a: boot from RAM
# mkdir -p boot/iso 1
# mount /dev/<usb partition> 1
# cp 1/boot/iso/<Centos ISO> boot/iso
# /init

2b: boot from USB
# mkdir -p boot 1
# mount /dev/<usb partition> 1
# ln -s /1/boot/iso /boot
# /init

2014-03-14

Tiny Core Linux QEMU

xorg-server-dev
gettext-dev
glib2-dev
sdl-dev

./configure --prefix=/opt/qemu/qemu --interp-prefix=/opt/qemu/gnemul/qemu-%M

make

make install

/opt/qemu/qemu/bin/qemu-system-i386 -m 128 -cdrom /Source/android/android-x86-4.4-RC1.iso

/opt/qemu/qemu/bin/qemu-img create /mnt/sdb1/vBox/Win8/hd.img 10G


Win8 x86:
qemu-system-i386 -m 1024 -cpu core2duo -cdrom 9600.16384.WINBLUE_RTM.130821-1623_X86FRE_ENTERPRISE_EVAL_ZH-TW-IRM_CENA_X86
FREE_ZH-TW_DV5.ISO


2014-03-13

Linux Package Install/Upgrade

yum centos
apt-get ubuntu
zypper openSUSE chrome

cpan perl

Apache Tomcat MySQL

This summary is not available. Please click here to view the post.

Tiny Core Linux Splunk


SPLUNK_HOME=/opt/splunk
export SPLUNK_HOME

gzip -dc splunk-6.0.1-189883-Linux-x86_64.tgz | tar xfv - -C /opt

cd /opt/splunk
mv var var.bak
mkdir var
sudo mount -t ext4 <dev> var
mv var.bak/* var

bin/splunk start



err* OR crit* OR emer* OR fau* OR fail* OR cpu OR mem* OR limit* | rex mode=sed "s/No matching connection for ICMP error message: icmp src outside:\d+\.\d+\.\d+\.\d+ dst identity:(\d+\.\d+\.\d+\.\d+) \(type \d+, code \d+\) on outside interface\.\s+Original IP payload: .*/No matching connection for ICMP error message: icmp src outside:?.?.?.? dst identity:\1 (type ?, code ?) on outside interface. Original IP payload: .../" | rex mode=sed "s/ detected \d+ output discard/ detected ? output discard/" | rex mode=sed "s/4294\d{3}%/4,???,???%/" | rex mode=sed "s/\s\(\d+-\d+-\d+ \d\d:\d\d:\d\d\)//" | rex field=_raw "^(?<TIME>\d+-\d+-\d+T\d+:\d+:\d+)\.\d+\+\d+:\d+\s+(?<LogHost>\d+\.\d+\.\d+\.\d+)\s+" | rex field=_raw "\s(?<LOG>(?:%|\[\w*\]).*)" | fillnull value="n/a" LOG | stats count, sparkline(count, 2h) as Trend, max(TIME) AS LastTime, max(_time) AS s by host, LOG | sort -s | fields LastTime, host, LOG, count, Trend

xxx  NOT icmp| rex field=_raw "\s(?<Protocol>[\w]+)\ssrc\s+[^ ]+:(?<FromHost>[0-9.]+)(?:/?[0-9]*) dst\s+[^ ]+:(?<ToHost>[0-9./]+) " | fillnull value="n/a" | stats count, sparkline(count) as Trend by FromHost, ToHost, Protocol

\[(?P<Thread>[0-9][0-9])\]\s+<(?P<Time>[0-9][0-9]:[0-9][0-9])\s+(?P<Service>\w+)>\s+(?P<Action>[a-z:]+): Next (?P<RecordFrom>[0-9]+) - (?P<RecordTo>[0-9]+) \(Head (?P<RecordHead>[0-9]+)\)

\s(?P<Type>\w+)\s+(?P<SourceIP>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\.(?P<SourcePort>[0-9]{0,5})\s+>\s+(?P<DestIP>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\.(?P<DestPort>[0-9]{0,5}):\s+(?P<Flag>.{1,2})\s+(?P<SeqNoLast>[0-9]+):(?P<SeqNo>[0-9]+)\((?P<byte>[0-9]+)\)\s+ack\s+(?P<SeqNoAck>[0-9]+)\s+win\s+(?P<Window>[0-9]+)

\s(?P<Type>\w+)\s+(?P<SourceIP>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\.(?P<SourcePort>[0-9]{0,5})\s+>\s+(?P<DestIP>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\.(?P<DestPort>[0-9]{0,5}):\s+(?P<Flag>.{1,2})\s+ack\s+(?P<SeqNoAck>[0-9]+)\s+win\s+(?P<Window>[0-9]+)

\s(?P<Type>\w+)\s+(?P<SourceIP>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\.(?P<SourcePort>[0-9]{0,5})\s+>\s+(?P<DestIP>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\.(?P<DestPort>[0-9]{0,5}):\s+(?P<Flag>.{1,2})\s+(?P<SeqNoLast>[0-9]+):(?P<SeqNo>[0-9]+)\((?P<byte>[0-9]+)\)\s+win\s+(?P<Window>[0-9]+)

TCP Sequence Randomization

| timechart sum(byte) by SourceIP, SourcePort, DestIP, DestPort

| rex field =_raw "(?P<proto1>\w+) blah (?P<proto2>\w+)" | eval proto=coalesce(proto1, proto2)

| top Flag
| where isnull(Flag)
| where isnotnull(Flag)

| stats sum(byte) as Sum | gauge Sum 200000 400000 600000 800000

... | strcat host "::" port address

| iplocation
status=404 | top 5 referer_domain
status=404 | top 5 referer_domain | search count>2
* | eval kbytes = bytes/1024
gender=female |sort -iq |dedup hair, eyes |eval bmi=weight/height
status=404 | timechart count
status=200 | timechart sum(bytes)
status=200 | timechart sum(bytes) by referer
status=200 | chart sum(bytes) as “Total Bytes” over date_wday
status=200 | chart sum(bytes) over date_wday by referer
status=200 | rare 100 uri | search count>1
status=200 | stats sum(bytes), max(bytes)
status=200 | stats max(bytes) by referer
... | rename _ip as IPAddress
... | replace *localhost with localhost in host
... | dedup host Remove duplicates of results with the same host value.

... | head 20
... | reverse
... | sort ip, -url
... | tail 20

--

props.conf
[my_sourcetype]
...
REPORT-fields = my_fields

transforms.conf
[my_fields]
REGEX = (?m-s)^SPARAM\|\d*\|([^|]+)\|(.*)
FORMAT = $1::$2

--


[get-username]
REGEX = by\s(\w+)\son
FORMAT = username::$1

--

Tiny Core Linux Cups


                st2 cups-pdf

        st2 cups
        st2 ghostscript
        sudo /bin/cp -r ~/.config/cups/ppd /usr/local/etc/cups
        sudo /bin/cp ~/.config/cups/cupsd.conf* /usr/local/etc/cups
        sudo /bin/cp ~/.config/cups/printers.conf* /usr/local/etc/cups
        sudo /bin/cp ~/.config/fx/etc/* /usr/local/etc/cups
        sudo /bin/cp ~/.config/fx/filter/* /usr/local/lib/cups/filter
        sudo cupsd

        cd /home/tc
        ln -s /var/spool/cups-pdf/tc pdf

Tiny Core Linux minicom USB

        sudo touch /usr/local/etc/minirc.s0
        sudo touch /usr/local/etc/minirc.usb0

usb-serial-3.8.13-tinycore.tcz
usb-serial-3.8.13-tinycore64.tcz

Tiny Core Linux LibreOffice


LOsrc=/mnt/tcz/tool/libre/LibreOffice_4.1.4_Linux_x86_rpm.tar.gz
LOrpm=LibreOffice_4.1.4.2_Linux_x86_rpm
LOhome=libreoffice4.1

        gzip -dc ${LOsrc} | tar xfv - -C /opt
        find /opt/${LOrpm} -name \*.rpm -exec sudo rpm -i \{\} \;
        /bin/rm -rf /opt/${LOrpm}
        ln -s ${LOhome} /opt/libreoffice


Tiny Core Linux WinPE

         cabextract
         coreutils
         mkisofs-tools
         mtools
         syslinux
         util-linux

wimlib
imagex

=============================

http://technet.microsoft.com/en-us/library/hh824911.aspx
http://technet.microsoft.com/en-us/library/dd744554(v=WS.10).aspx
http://technet.microsoft.com/en-us/library/dd744252(v=ws.10).aspx
http://technet.microsoft.com/en-us/library/dd744592(v=ws.10).aspx
http://technet.microsoft.com/en-us/library/dd744560(v=ws.10).aspx
http://technet.microsoft.com/en-us/library/dd744284(v=ws.10).aspx

mkdir c:\winpe
cd c:\winpe

copype.cmd x86 c:\winpe\001

cd 001
copy winpe.wim iso\sources\boot.wim

dism /Mount-Wim /WimFile:C:\winpe\001\iso\sources\boot.wim /index:1 /MountDir:C:\winpe\mp

dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-fontsupport-zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-hta.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-legacysetup.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-mdac.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-pppoe.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-scripting.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-setup-client.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-setup-server.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-setup.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-wds-tools.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-wmi.cab"

dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\lp_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-hta_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-legacysetup_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-mdac_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-PPPOE_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-scripting_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-setup-client_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-setup-server_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-setup_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-wds-tools_zh-tw.cab"
dism /image:C:\winpe\mp /Add-Package /PackagePath:"c:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\zh-tw\winpe-wmi_zh-tw.cab"

dism /image:c:\winpe\mp /Enable-profiling

Dism /Get-MountedWimInfo

dism /Unmount-Wim /MountDir:C:\winpe\mp\ /Commit

http://technet.microsoft.com/en-us/library/dd799303(v=ws.10).aspx

Oscdimg -n -bC:\winpe\001\Etfsboot.com C:\winpe\001\ISO C:\winpe\winpe_waik_x86.iso

Tiny Core Linux VirtualBox


        st2 python
        st2 procps

        # TODO modprode -c

        # fix busybox
        if [ -f /bin/ps -a -f /usr/local/bin/ps ]; then
                sudo mv /bin/ps /bin/ps.busybox
                sudo ln -s /usr/local/bin/ps /bin
        fi

        bzip2 -dc ${VBOXBIN} | sudo tar xfv - -C /

#       bzip2 -dc ${VBOXMISCBIN} | sudo tar xfv - -C /opt/VirtualBox
        sudo insmod ${VBOXMISC}/vboxdrv.ko
        sudo insmod ${VBOXMISC}/vboxnetadp.ko
        sudo insmod ${VBOXMISC}/vboxnetflt.ko
        sudo insmod ${VBOXMISC}/vboxpci.ko

        sudo chmod g-w /opt

        sudo /etc/init.d/vboxdrv status
        sudo /etc/init.d/vboxballoonctrl-service status
        sudo /etc/init.d/vboxweb-service status
        # sudo /etc/init.d/vboxautostart-service start
        sudo /etc/init.d/vboxdrv start



Tiny Core Linux Wifi

        st2 firmware
#       st2 firmware-broadcom_bcm43xx
        st2 firmware-iwlwifi

        st2 wifi
        st2 wl-modules-$PPPR
        st2 iw
        st2 pci-utils

Tiny Core Linux IP Tunnel

A:
ip tunnel del tun0 mode ipip remote 192.168.3.112 local 172.16.0.81

ip tunnel add tun0 mode ipip remote 192.168.3.112 local 172.16.0.81
ip addr add 172.16.1.81/24 peer 172.16.1.112/24 dev tun0
ip link set tun0 up

#route add -net 192.168.1.0/24 gw 172.16.1.112


B:
ip tunnel add tun0 mode ipip remote 192.168.3.115 local 172.16.0.81
ip addr add 172.16.4.81/24 peer 172.16.4.115/24 dev tun0
ip link set tun0 up

route add -net 192.168.4.0/24 gw 172.16.4.115


===============


/sbin/ifconfig ip.tun2 plumb
/sbin/ifconfig ip.tun2 172.16.3.91 172.16.3.81 tsrc 192.168.21.91 tdst 192.168.15.81
/sbin/ifconfig ip.tun2 up

route add net 192.168.3.0/24 172.16.3.81

ip tunnel add tun2 mode ipip remote 192.168.21.91 local 192.168.15.81
ip addr add 172.16.3.81/24 peer 172.16.3.91/24 dev tun2
ip link set tun2 up



/sbin/ifconfig ip.tun0 plumb
/sbin/ifconfig ip.tun0 172.16.1.91 172.16.1.86 tsrc 192.168.2.91 tdst 192.168.6.86
/sbin/ifconfig ip.tun0 up

/sbin/ifconfig ip.tun0 down

/sbin/ifconfig ip.tun0 172.16.1.86 172.16.1.91 tsrc 192.168.6.86 tdst 192.168.2.91

Solaris
/sbin/ifconfig ip.tun1 plumb
/sbin/ifconfig ip.tun1 172.16.2.91 172.16.2.204 tsrc 192.168.2.91 tdst 192.168.1.204
/sbin/ifconfig ip.tun1 up


RedHat:
ip tunnel add tun0 mode ipip remote 192.168.2.91 local 192.168.1.204
ip addr add 172.16.2.204/24 peer 172.16.2.91/24 dev tun0
ip link set tun0 up

echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth0 -s 172.16.2.0/24 -j MASQUERADE

route add -net 192.168.3.0/24 gw 172.16.0.1 eth1

Tiny Core Linux Router

                st2 iptables

                sudo ifconfig ${IF2} $GWIP netmask $GWMASK

                echo 'echo "1" > /proc/sys/net/ipv4/ip_forward' > /opt/tcz/ipf
                chmod a+x /opt/tcz/ipf
                sudo /opt/tcz/ipf

                sudo modprobe ip_nat_ftp
                sudo modprobe ip_conntrack
                sudo modprobe ip_conntrack_ftp
                sudo modprobe ip_conntrack_irc

                sudo iptables -t nat -F
                sudo iptables -t nat -A POSTROUTING -o $IF1 -s "$GWSRC" -j MASQUERADE



/sbin/iptables-save -t nat > /home/mrtg/iptable.txt 2>&1

Tiny Core Linux Dev

PPPP=/mnt/sdc1/opt/tcz
PPPF=/mnt/tcz/font
PPPR=3.8.13-tinycore
PPPV=5.x
PPPm=i686
PPPM=x86
PPPL=/opt/tcz/tcz
PPPT=/mnt/tcz/i686/5.x
PPPC=Test
PPPI=eth0
PPPX=7.7
PPPG=32.0.1700.77



        st2 python.tcz

# http://www.tinycorelinux.net/5.x/x86/release/src/kernel/linux-3.8.13-patched.txz
# http://www.tinycorelinux.net/5.x/x86/release/src/kernel/config-3.8.13-tinycore
# http://www.tinycorelinux.net/5.x/x86/release/src/kernel/Module.symvers-3.8.13-tinycore

        st2 linux-kernel-sources-env.tcz
        st2 autoconf.tcz
        st2 automake.tcz
        st2 binutils.tcz
        st2 bison.tcz
        st2 cloog.tcz
        st2 compiletc.tcz
        st2 diffutils.tcz
        st2 e2fsprogs_base-dev.tcz
        st2 expat2.tcz
        st2 file.tcz
        st2 findutils.tcz
        st2 flex.tcz
        st2 gawk.tcz
        st2 gcc.tcz
        st2 gcc_base-dev.tcz
        st2 gcc_libs-dev.tcz
        st2 gcc_libs.tcz
        st2 glibc_base-dev.tcz
        st2 gmp.tcz
        st2 grep.tcz
        if [ "$PPPM" = "x86" ]; then
                st2 linux-3.8.3_api_headers.tcz
        else
                st2 linux-3.8.10_api_headers.tcz
        fi
        st2 m4.tcz
        st2 make.tcz
        st2 mpc.tcz
        st2 mpfr.tcz
        st2 ncurses-common.tcz
        st2 ncurses-dev.tcz
        st2 ncurses.tcz
        st2 patch.tcz
        st2 perl5.tcz
        st2 perl_xml_parser.tcz
        st2 pkg-config.tcz
        st2 ppl.tcz
        st2 sed.tcz
        st2 util-linux_base-dev.tcz
        st2 zlib_base-dev.tcz

if [ 1 = 1 ]; then
        tmp=/mnt/tcz/tool/kernel.src/${PPPM}
        /bin/cp ${tmp}/Module.symvers-${PPPR} \
                ${tmp}/config-${PPPR} \
                ${tmp}/linux-3.8.13-patched.txz \
                /tmp
fi
        sudo linux-kernel-sources-env.sh

        CC=/usr/local/bin/cc
        CPP=/usr/local/bin/cpp
        export CC
        export CPP
        CPPFLAGS="-I/usr/local/src/linux-headers-${PPPR}/include -I/usr/local/src/linux-headers-${PPPR}/arch/${PPPM}/include"
        export CPPFLAGS

        updateFile /home/tc/.ashrc "CC=/usr/local/bin/cc"
        updateFile /home/tc/.ashrc "CPP=/usr/local/bin/cpp"
        updateFile /home/tc/.ashrc "export CC"
        updateFile /home/tc/.ashrc "export CPP"
        updateFile /home/tc/.ashrc "CPPFLAGS=\"-I/usr/local/src/linux-headers-${PPPR}/include -I/usr/local/src/linux-headers-${PPPR}/arch/${PPPM}/include\""
        updateFile /home/tc/.ashrc "export CPPFLAGS"

Tiny Core Linux Partition Label


ext2/ext3 Partitions
There are two commands:
tune2fs -L my_label /dev/partition
/sbin/e2label /dev/partition my_label

Dos Partition Label (mtools better)
dosfstools.tcz
   dosfslabel /dev/xxxx [LABEL]

FAT/FAT16/FAT32 Partitions
You must install the mtools utility package.

Then type
sudo mlabel -i /dev/partition ::my_label

/etc/mtools.conf
drive p: file="/dev/sdb1"

~/.mtoolsrc
mtools_skip_check=1

mlabel p:<label>


NTS Partitions:
You must install the ntfsprogs package

The command to be used is:
ntfslabel /dev/partition my_label.