Sunday, August 5, 2018

Friendship day celebration

Friendship day celebration
https://twitter.com/nagarajanewlife/status/1026355786316804097

Monday, July 30, 2018

Script to Disable Mouse Right Click

Script to Disable Mouse Right Click

  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $(".disableEvent").on("contextmenu",function(){
  4. alert('right click disabled');
  5. return false;
  6. });
  7. });
  8. </script>

Script to Disable Cut Copy & Paste

Using this script, you can prevent user to cut (CTRL+X), copy (CTRL+C) and paste (CTRL+V)content from your web pages.
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $('.disableEvent').bind('cut copy paste', function (e) {
  4. e.preventDefault();
  5. });
  6. });
  7. </script>
  8. As far as I can see, the secret sauce is, that Ctrl+S does NOT fire the keypress event, only the keydown event.
    $(document).bind('keydown', 'ctrl+s', function(e) {
        e.preventDefault();
        alert('Ctrl+S');
        return false;
    });
    Only with jQuery:
    $(document).bind('keydown', function(e) {
      if(e.ctrlKey && (e.which == 83)) {
        e.preventDefault();
        alert('Ctrl+S');
        return false;
      }
    });

    Disable saving web page with CTRL-S using JQuery

    Use below JQuery code to disable saving web page using "CTRL-S" keyword directly. This will work well on all browser (IE, Firefox, Google chrome). // To prevent saving web site directly using "ctrl-s" $(document).bind('keydown keypress', 'ctrl+s', function () {         $('#save').click();         return false;     });
     

firewallD command add & remove

port enable or not 
[root@proxy ]# firewall-cmd --zone=public --query-port=80/tcp

remove rules:

firewall-cmd --permanent --zone=public --remove-forward-port port=80:proto=tcp:toport=3128:toaddr=192.168.1.179
success
 


firewall-cmd --reload
 
remove port nmuber: 
 
[root@proxy ~]# firewall-cmd --permanent --zone=public --remove-port=80/tcp
success
[root@proxy ~]# firewall-cmd --reload
success
 
 
 
list firewall rules:
 
 
firewall-cmd --list-all


list active zone


firewall-cmd --get-active-zone




 

Saturday, July 28, 2018

How to Configure Squid 3.x as Transparent Proxy on CentOS 7




 


vi /etc/squid/squid.conf



# Squid normally listens to port 3128
http_port 3128  transparent



visible_hostname proxyserver.nagarajanewlife.com


acl our_network  src 192.168.1.0/24

http_access allow our_network




firewall-cmd --permanent --zone=public --add-forward- port=80:proto=tcp:toport=3128:toaddr=192.168.1.175

firewall-cmd --permanent --zone=public --add-port=3128/tcp
firewall-cmd --permanent --add-masquerade

firewall-cmd --reload

systemctl restart squid

# firewall-cmd --list-all


$ sudo vi /etc/sysctl.conf
then change the following parameter to ‘1’, i.e.
net.ipv4.ip_forward = 1
Save file & exit. Now execute the following command to implement the changes made,
$ sudo sysctl -p






Dhcp server configure 

vi /etc/dhcp/dhcpd.conf
edit the default gateway 192.168.1.175 # systemctl restart squid