Thursday, February 23, 2017

Code Highlight for blog in Javascript + GoogleDrive as CDN

Code Highlight for blog in Javascript + GoogleDrive as CDN

UPDATE:
Foud a bit better BloggerScripts with jQuery:
[code]test test test Blogger Shortcode Plugin[/code]

 [quote]" Yeah, I am really enjoying the normal use of shortcodes :) "[/quote]

Paste following code just before end of head section:
1:  <link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>  
2:  <link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>  
3:     
4:  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/>   
5:  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js' type='text/javascript'/>   
6:  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>   
7:  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>   
8:  <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/>   

And the following before the body tag

1:  <script language='javascript'>  
2:    SyntaxHighlighter.config.bloggerMode = true;  
3:    SyntaxHighlighter.all();  
4:  </script>  
</ br> </ br> Also use the CodeFormatter to escape html characters: https://codeformatter.blogspot.cz/


::below is from komku.org::

Step 1 & 2:
Upload and Select file > Click Open


select the files

Step 3:
Select the checkbox to select the file > Click the Share button

click share button

Step 4:
Click Change...

click change

Step 5:
Change the sharing settings from "Private" to "Public on the web" > Click Save

change the sharing settings

Step 6:
Copy the link > paste in Notepad

Example:  
https://docs.google.com/file/d/0B47Pdqj--olfVVg3MFgxVlpqd0k/edit?usp=sharing
File ID: 0B47Pdqj--olfVVg3MFgxVlpqd0k

Paste the file id after: https://googledrive.com/host/

Direct link to the file:
https://googledrive.com/host/0B47Pdqj--olfcUNkV3o3SjdoVGM

copy the file id - google drive
 

Download from youtube via CLI

Download from youtube via CLI


 sudo apt install youtube-dl
cd Downloads
youtube-dl https://www.youtube.com/watch?v=6v9LjFd2ztQ

 sudo apt install youtube-dl 
 cd Downloads 
 youtube-dl https://www.youtube.com/watch?v=6v9LjFd2ztQ 

Wednesday, February 22, 2017

Ubuntu upstart - apps to blame

Ubuntu upstart - apps to blame

 
systemd-analyze blame
systemd-analyze time

sudo systemctl disable xx.service




Tuesday, February 21, 2017

OpenVPN install on Ubuntu 16.04

VPN install on Ubuntu 16.04

How to do it


curl http://ip.mtak.nl
 -- show up your current public IP address 

https://diafygi.github.io/webrtc-ips/
 -- try WebRTC leak

iptables -I INPUT 1 -p tcp –dport 1723 -j ACCEPT
iptables -I INPUT 1 -p gre -j ACCEPT

tcpdump -i eth0 port 1723
tcpdump -i eth0 proto 47



apt-get install fail2bandepending on the Linux distro, the iptables FORWARD chain is probably set to a default policy of ACCEPT, which means as soon as you turn IP forwarding on in the kernel (the sysctl command), you are allowing your server to act as a open router.
If the VPN server is behind a NAT router, the forwarding security can be a bit more open for data traffic.

sudo netstat -tulpn 

make-cadir /var/easy-rsa
cd /var/easy-rsa
ln -s openssl-1.0.0.cnf openssl.cnf

openssl dhparam 4096 > /etc/openvpn/dh4096.pem

openvpn --genkey --secret /etc/openvpn/easy-rsa/keys/ta.key   

nano vars
export KEY_COUNTRY="US"
export KEY_PROVINCE="NJ"
export KEY_CITY="Matawan"
export KEY_ORG="Your Awesome Organization"
export KEY_EMAIL="me@your_awesome_org.com"
export KEY_OU="YourOrganizationUnit" 
 
./clean-all
./build-ca
 
./build-key-server server
 
./build-dh
 
./build-key client
 
cd keys
cp ca.crt ca.key server.crt server.key ta.key dh2048.pem /etc/openvpn
cd ..
 
gunzip -c /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz | tee /etc/openvpn/server.conf
 
nano server.conf
push "redirect-gateway def1 bypass-dhcp"
user nobody
group nogroup
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
tls-auth ta.key 0
 
tls-auth key-direction 0
 
nano /etc/sysctl.conf
net.ipv4.ip_forward=1
 
sysctl -p
  
iptables -t nat -A POSTROUTING -s 10.8.0.0/16 -o eth0 -j MASQUERADE
 
service openvpn start
 
       
 
  
--------------
 
apt-get install xl2tpd ppp lsof
(  apt-get install strongswan  ) 
sudo apt-get install pptpd -y
 
sudo nano /etc/ppp/pptpd-options 
 
 ms-dns 8.8.8.8
ms-dns 8.8.4.4
 
sudo nano /etc/pptpd.conf
localip 10.0.0.1
remoteip 10.0.0.100-200
 
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
 
sudo service pptpd start
 
sudo apt-get install pptp-linux network-manager-pptp network-manager-pptp-gnome 
 
  
echo "net.ipv4.ip_forward = 1" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.all.accept_redirects = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.all.send_redirects = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.default.rp_filter = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.default.accept_source_route = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.default.send_redirects = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.icmp_ignore_bogus_error_responses = 1" |  tee -a /etc/sysctl.conf
 
nano /etc/ppp/chap-secrets
 
# Secrets for authentication using CHAP
# client       server  secret                  IP addresses
alice          l2tpd   password1            *
bob            l2tpd   passWd2             *   
 
ipsec restart
/etc/init.d/xl2tpd restart 
       
 

Locale - Setting perl locale failed *Linux*

Locale - Setting perl locale failed *Linux*

How to restore locale on Ubuntu


When trying to install a new app, getting:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
 
 
How to fix it?

Get into terminal Ctrl + Alt + T and write down:

man locale-gen
 
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales


Problem fixed.