Monday, October 29, 2018
Tuesday, October 9, 2018
Saturday, September 8, 2018
Sunday, August 5, 2018
Friendship day celebration
Friendship day celebration
https://twitter.com/nagarajanewlife/status/1026355786316804097
Wednesday, August 1, 2018
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
solution:
ssh-keygen -R hostname
solution:
ssh-keygen -R hostname
Monday, July 30, 2018
Script to Disable Mouse Right Click
Script to Disable Mouse Right Click
- <script type="text/javascript">
- $(document).ready(function() {
- $(".disableEvent").on("contextmenu",function(){
- alert('right click disabled');
- return false;
- });
- });
- </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.
- <script type="text/javascript">
- $(document).ready(function() {
- $('.disableEvent').bind('cut copy paste', function (e) {
- e.preventDefault();
- });
- });
- </script>
- As far as I can see, the secret sauce is, that Ctrl+S does NOT fire the keypress event, only the keydown event.
Only with jQuery:$(document).bind('keydown', 'ctrl+s', function(e) { e.preventDefault(); alert('Ctrl+S'); return false; });
$(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
list active zone
firewall-cmd --get-active-zone
[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
# 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
How to Set Time centos 7
timedatectl set-ntp truetimedatectl set-timezone Asia/Kolkata
timedatectl set-ntp 1
or
timedatectl set-timezone UTC
timedatectl set-time 15:58:30
Failed to set time: Automatic time synchronization is enabled
timedatectl set-ntp false
Setup network on CentOS 7 minimal
First, type “nmcli d” command in your terminal for quick list ethernet card installed on your machine:
Type “nmtui” command in your terminal to open Network manager. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options).
Type “nmtui” command in your terminal to open Network manager. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options).
service network restart
Friday, July 27, 2018
ERROR: No forward-proxy ports configured centos 7
# tail -f /var/log/squid/cache.log
ERROR: No forward-proxy ports configured
ERROR: No forward-proxy ports configured
ERROR: No forward-proxy ports configured
ERROR: No forward-proxy ports configured
Solution:
http_port 3128
http_port 8080 intercept
how to install squid centos 7 minmal
#yum -y install epel-release
# yum -y update
#yum clean all
#yum install squid -y
Thursday, July 26, 2018
how to remove port number in firewalld centos 7
Solution: Do not forget the --runtime-to-permanent
$ firewall-cmd --zone=public --remove-port=10050/tcp
$ firewall-cmd --runtime-to-permanent
$ firewall-cmd --reload
# firewall-cmd --list-all
Subscribe to:
Posts (Atom)