Linux & Windows Tips, Tutorials, , Ideas

How To add SQUID Proxy Server with MIKROTIK

linux1.pro-east4serv-linux

To add SQUID Proxy Caching Server support in Mikrotik, Assuming the following Scenario.

DSL MODEM IP = 192.168.1.1
MIKROTIK LAN IP = 10.0.0.1
SQUID LAN IP = 192.168.2.1

I assume that you already have working Mikrotik in place, and Already configured SQUID Server ready, (You can search guides about there configurations at my blog), I will just show you how to interconnect them together so All users browsing port 80 request will go to SQUID for caching facility)

Read more about How To add SQUID Proxy Server with MIKROTIK

Share Button

HowTo: Find a Directory On Linux Based System

I just switched from MS-Windows server admin to Debian Linux server admin role. I need to find a directory called project.images. I was also told that the locate command is the simplest and quickest way to find the locations of files and directories on Linux. But, the locate command is not working out for me.Read more about HowTo: Find a Directory On Linux Based System[…]

Share Button

MySQL – myisamchk: error: myisam_sort_buffer_size is too small

f you’re trying to repair large MyISAM tables in MySQL, you can run into the following restriction, because of the limited size of the default Sort Buffer. [email protected] # myisamchk -r table.MYI – recovering (with sort) MyISAM-table ‘table.MYI’ Data records: 335045 – Fixing index 1 Found block that points outside data file at 1509428340 FoundRead more about MySQL – myisamchk: error: myisam_sort_buffer_size is too small[…]

Share Button

Mikrotik Hotspot: Different login page for Mobile Users

Recently a Nigerian friend asked about how we can configure different login page for Mobile users , which could be a light weight and customized for mobile/pda screen size with customized welcome message. Following is a quick method on how you can display different login page if user is login from mobile or device, & default login page for desktop users.
This is quick method, but if you want more sophisticated method like detect client by device, then you can use variable functions and act accordingly.
First the logic: You have to create 3 html pages,

1-     login.html
2-    mobilelogin.html
3-    otherlogin.html

1- login.html [Re directer which check user device/screen size]

login.html page is a kind of re directer which will actually check the screen size of client device/screen. If it found it less then 800/600 , it will assume its a mobile device and will redirect to mobilelogin.html,
otherwise it will display another login page otherlogin.html which could be default login page for all.
First create login.html

1
2
3
4
5
6
7
8
<script type="text/javascript">
if ((screen.width<=800) && (screen.height<=600)) {
document.location="mobilelogin.html";
}
else {
document.location="otherlogin.html";
}
</script>

Read more about Mikrotik Hotspot: Different login page for Mobile Users

Share Button

LVM How-to: Adding a new partition Linux

Initial setup

To begin, let’s define our goals: We have a partition (mounted as /), which we want to extend from 7G to 16G. We will do this by following these steps:

  1. Partition the new disk
  2. Create New Physical Device (pvcreate)
  3. Extend the existing volume group
  4. Extend the logical volume
  5. Extend the filesystem (ext4 in my case)

Read more about LVM How-to: Adding a new partition Linux

Share Button

Linux / UNIX: Change File Permissions Recursively ( conditional )

How do I recursively change files with 777 permissions to 755 in /home/user/demo directory? I have a number of files in this directory and I need to change permission from 0777 to only if that file has 777 permissions. Is there an easy way out to achieve this on a Linux or Unix-like systems? ToRead more about Linux / UNIX: Change File Permissions Recursively ( conditional )[…]

Share Button