Standard

Squid Cache 3.4.8 @ Debian 8.3 Jessie quick install/config with privacy…

# apt-get install squid3 squid3-common -y

# cat /etc/squid3/squid.conf |grep -v -E ^#|^ /etc/squid3/squid.conf_no_comm
# mv /etc/squid3/squid.conf /etc/squid3/squid.conf_ORIG_BULKA

# mv /etc/squid3/squid.conf_no_comm /etc/squid3/squid.conf

Now we need to add new acl some privacy settings:

####ACL ALLOW ACCESS:#####

acl some-name src 94.20.31.25/32 85.132.16.18/32 10.15.16.0/24
http_access allow some-name
#####
cache_mgr [email protected]
#
#Privacy Things
via off
forwarded_for off
httpd_suppress_version_string on

############

finally your connfig should be like this:

# cat /etc/squid3/squid.conf
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT
#
acl some-name src 94.20.31.25/32 85.132.16.18/32 10.15.16.0/24
http_access allow some-name
#
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
http_access allow localhost
http_access deny all
http_port 6655
coredump_dir /var/spool/squid3
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
#
#administrator contact:
cache_mgr [email protected]
#
#Privacy Things
via off
forwarded_for off
httpd_suppress_version_string on 

############

restart squid3 service:
# /etc/init.d/squid3 restart

Done….

squid_test
squid_error
# date
Wed Mar 30 14:50:49 AZT 2016

more
Standard

No Summer Time for Azerbaijan…

Recently our government decided to cancel summer time switching…
So we need to make changes on our Linux/UNIX environment.
Here are steps how we can do it on Linux servers.

Check current rule:


# zdump -v Asia/Baku | grep 2016
Asia/Baku  Sat Mar 26 23:59:59 2016 UTC = Sun Mar 27 03:59:59 2016 AZT isdst=0 gmtoff=14400
Asia/Baku  Sun Mar 27 00:00:00 2016 UTC = Sun Mar 27 05:00:00 2016 AZST isdst=1 gmtoff=18000
Asia/Baku  Sat Oct 29 23:59:59 2016 UTC = Sun Oct 30 04:59:59 2016 AZST isdst=1 gmtoff=18000
Asia/Baku  Sun Oct 30 00:00:00 2016 UTC = Sun Oct 30 04:00:00 2016 AZT isdst=0 gmtoff=14400

We see that rule will be applied @Sun Mar 27 2016…

###############################
You can download new database from IANA released 12 March 2016.
It does not include changes for Azerbaijan…

# mkdir ./new_tz
# cd ./new_tz
# wget https://www.iana.org/time-zones/repository/releases/tzdata2016b.tar.gz
# tar -zxvf tzdata2016b.tar.gz

# cat ./asia  | grep Azer

# Azerbaijan
# From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23):
Rule    Azer    1997    max    -       Mar     lastSun  4:00   1:00    S
Rule    Azer    1997    max    -       Oct     lastSun  5:00   0       -
                        4:00    -       AZT     1996     # Azerbaijan Time
                        4:00    Azer    AZ%sT

# vi ./asia

136 # Rule  NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
137 Rule    Azer    1997    max     -       Mar     lastSun  4:00   1:00    S
138 Rule    Azer    1997    max     -       Oct     lastSun  5:00   0       -</pre>

Now we need to change max to 2015; it means that rule will be applied last time @2015…

136 # Rule  NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
137 Rule    Azer    1997    2015     -       Mar     lastSun  4:00   1:00    S
138 Rule    Azer    1997    2015     -       Oct     lastSun  5:00   0       -

# zic ./asia
# tzdata-update

##############################
##############################

I have mirrored ready archive to be just implemented on Linux servers….

# wget http://anit.az/tzdata2016b_BAKU_2015.tar.gz
# tar -xvf ./tzdata2016b_BAKU_2015.tar.gz
# cd ./new_tz
# zic ./asia
# tzdata-update

#######CHECK NEW RULE

# zdump -v Asia/Baku | grep 2015 || zdump -v Asia/Baku | grep 2016

Asia/Baku  Sat Mar 28 23:59:59 2015 UTC = Sun Mar 29 03:59:59 2015 AZT isdst=0 gmtoff=14400
Asia/Baku  Sun Mar 29 00:00:00 2015 UTC = Sun Mar 29 05:00:00 2015 AZST isdst=1 gmtoff=18000
Asia/Baku  Sat Oct 24 23:59:59 2015 UTC = Sun Oct 25 04:59:59 2015 AZST isdst=1 gmtoff=18000
Asia/Baku  Sun Oct 25 00:00:00 2015 UTC = Sun Oct 25 04:00:00 2015 AZT isdst=0 gmtoff=14400

# date
Sat Mar 19 16:47:03 AZT 2016

we never will see such format for Azerbaijan:

Thu Aug 27 02:49:26 AZST 2015

AZST ST means Summer Time :)

Until now it will always show as AZT …Just time, no summer time anymore for Azerbaijan…:)

###############################

SOLARIS 9/10 fix:

vi /usr/share/lib/zoneinfo/src/asia

Same rule, change max to 2015.

#
Rule   Azer    1997    2015     –       Mar     lastSun  4:00   1:00    S
Rule   Azer    1997    2015     –       Oct     lastSun  5:00   0       –
#

zic /usr/share/lib/zoneinfo/src/asia

###############################

Linux Debian DST fix…

# wget http://anit.az/tzdata2016b_BAKU_2015.tar.g
# tar -xvf ./tzdata2016b_BAKU_2015.tar.gz
# cd ./new_tz/
# zic ./asia
# dpkg-reconfigure tzdata
set Asia/Baku…

root@debie ~/new_tz # cat /etc/debian_version
7.2
root@debie ~/new_tz # date
Mon Mar 28 14:25:51 AZT 2016

Done….

more
Standard

Extend the root partition LVM или подкинул блоков в логический корень :)

Working environment is:

[~]# cat /etc/redhat-release 
CentOS release 5.11 (Final)

#####################################
Server running on ESXi host and root space was filled up,
I have increased virtual disk and then LVM needs to be resized thru the system…
#####################################
Simple steps log:


[~]# fdisk -l

Disk /dev/sda: 139.5 GB, 139586437120 bytes
255 heads, 63 sectors/track, 16970 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        5221    41833260   8e  Linux LVM

#################################



[~]# lvs    
  LV       VG         Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  LogVol00 VolGroup00 -wi-ao  39.38G                                      
  LogVol01 VolGroup00 -wi-ao 512.00M  

#################################

[~]# df -h
Filesystem                      Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00  39G   27G  9.6G  74% /
/dev/sda1                        99M   38M   56M  41% /boot
tmpfs                            125M     0  125M   0% /dev/shm

#################################

[~]# vgs
  VG         #PV #LV #SN Attr   VSize  VFree
  VolGroup00   1   2   0 wz--n- 39.88G    0 

################################

[~]# fdisk /dev/sda

The number of cylinders for this disk is set to 16970.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (5222-16970, default 5222): 
Using default value 5222
Last cylinder or +size or +sizeM or +sizeK (5222-16970, default 16970): 
Using default value 16970

Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.


[~]# reboot

Broadcast message from root (pts/1) (Fri Mar 18 15:42:28 2016):

The system is going down for reboot NOW!

#####################################

[~]# fdisk -l

Disk /dev/sda: 139.5 GB, 139586437120 bytes
255 heads, 63 sectors/track, 16970 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        5221    41833260   8e  Linux LVM
/dev/sda3            5222       16970    94373842+  8e  Linux LVM

[~]# mkfs.ext3 /dev/sda3
mke2fs 1.39 (29-May-2006)
warning: 500 blocks unused.

Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
11819520 inodes, 23592960 blocks
1179673 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
720 block groups
32768 blocks per group, 32768 fragments per group
16416 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

##########################################

[~]# vgextend VolGroup00 /dev/sda3
  Volume group "VolGroup00" successfully extended

##########################################

[~]# vgs
  VG         #PV #LV #SN Attr   VSize   VFree 
  VolGroup00   2   2   0 wz--n- 129.88G 90.00G

##########################################

[~]# lvextend -l +100%FREE /dev/VolGroup00/LogVol00
  Extending logical volume LogVol00 to 129.38 GB
  Logical volume LogVol00 successfully resized

##########################################

[~]# resize2fs /dev/VolGroup00/LogVol00
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/LogVol00 to 33914880 (4k) blocks.
The filesystem on /dev/VolGroup00/LogVol00 is now 33914880 blocks long.

##########################################

[~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      126G   27G   93G  23% /
/dev/sda1              99M   38M   56M  41% /boot
tmpfs                 125M     0  125M   0% /dev/shm

##########################################

[~]# date
Fri Mar 18 18:43:20 AZT 2016

##########################################

Done….

more