Car drifting on BMW M4
I'd rather be in outer space 🛸
art blog(derogatory)

oozey mess
Aqua Utopia|海の底で記憶を紡ぐ
Lint Roller? I Barely Know Her

Discoholic 🪩
Game of Thrones Daily
h

roma★
cherry valley forever
KIROKAZE
wallacepolsom
One Nice Bug Per Day
Fai_Ryy

if i look back, i am lost
🩵 avery cochrane 🩵
ojovivo

PR's Tumblrdome
macklin celebrini has autism
noise dept.

seen from United States

seen from United States
seen from Singapore
seen from Argentina
seen from Kenya
seen from Venezuela
seen from United States

seen from Poland

seen from Ireland
seen from Venezuela
seen from T1

seen from United States

seen from Malaysia
seen from Ireland

seen from United Kingdom

seen from Malaysia

seen from United States

seen from Bangladesh
seen from Canada
seen from United States
@btushar
Car drifting on BMW M4
IPSec Timeout on Mac Patch
sudo mkdir /etc/racoon/remote
sudo mv /var/run/racoon/*.conf /etc/racoon/remote
sudo sed -i.bak 's/lifetime time 3600 sec/lifetime time 168 hours/' /etc/racoon/remote/*.conf
sudo patch /etc/racoon/racoon.conf <<EOF --- /etc/racoon.orig/racoon.conf 2009-06-23 09:09:08.000000000 +0200 +++ /etc/racoon/racoon.conf 2009-12-11 13:52:11.000000000 +0100 @@ -135,4 +135,5 @@ # by including all files matching /var/run/racoon/*.conf # This line should be added at the end of the racoon.conf file # so that settings such as timer values will be appropriately applied. +include "/etc/racoon/remote/*.conf" ; include "/var/run/racoon/*.conf" ; EOF
sudo launchctl stop com.apple.racoon
sudo launchctl start com.apple.racoon
[crontab: “/bin/vi” exited with status 127]
[root@server ~]# crontab -e no crontab for root – using an empty one /bin/sh: /bin/vi: No such file or directory crontab: “/bin/vi” exited with status 127
Correct it by typing:
[root@server ~]# sudo ln -s /usr/bin/vi /bin/vi
Two network cards on centos
Assume the two interfaces are eth0 and eth1
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" NM_CONTROLLED="yes" ONBOOT=yes TYPE=Ethernet BOOTPROTO=static NAME="System eth0" GATEWAY=192.168.0.1 IPADDR=192.168.0.4 NETMASK=255.255.255.0
# vi /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE="eth1" NM_CONTROLLED="yes" ONBOOT=yes TYPE=Ethernet BOOTPROTO=static NAME="System eth1" IPADDR=10.168.9.4 NETMASK=255.255.255.252
Remember no GATEWAY here.
/etc/sysconfig/network-scripts/route-eth1
10.3.0.0/24 via 10.1.0.1 dev eth1
here 10.1.0.1 is your gateway for eth1
VPN on Ubuntu
1: Install pptpd and ufw. iptables can be used in place of ufw, but for the sake of easiness, ufw is better if you don't know iptables.
sudo apt-get install pptpd ufw
2: Open the ports needed. The guide suggests 22 (SSH) and 1723 for the pptp vpn.
sudo ufw allow 22 sudo ufw allow 1723 sudo ufw enable
3: Edit /etc/ppp/pptpd-options. Open the file with your favorite editor (mine's nano, so the command for me is sudo nano /etc/ppp/pptpd-options), and comment out these lines by putting a # before them, if you want this to work universally on all OSes:
refuse-pap refuse-chap refuse-mschap
You can comment this line if you want to disable encryption: require-mppe-128
4: While editing /etc/ppp/pptpd-options, add DNS servers for the VPN. This example uses OpenDNS servers:
ms-dns 208.67.222.222 ms-dns 208.67.220.220
5: Edit /etc/pptpd.conf. Open the file with your favorite editor (mine's nano, so the command for me is sudo nano /etc/pptpd.conf). You need to add the local VPN IPs for the system, so add:
localip 10.99.99.99 remoteip 10.99.99.100-199
If your system is a VPS, use the public IP for "localip". If it is not and is on a local network, use your computer's network IP. Use different IPs and ranges if these IPs exist on your subnet! If you don't know your public IP of your VPS, find it by running dig +short myip.opendns.com @resolver1.opendns.com
6: Edit /etc/ppp/chap-secrets. Open the file with your favorite editor (mine's nano, so the command for me is sudo nano /etc/ppp/chap-secrets), and add the auth data. The format for /etc/ppp/chap-secrets is:
[Username] [Service] [Password] [Allowed IP Address]
An example would be: sampleuser pptpd samplepassword *
7: Restart pptpd. Run this command in terminal: sudo /etc/init.d/pptpd restart
8: Edit /etc/sysctl.conf. Open the file with your favorite editor (mine's nano, so the command for me is sudo nano /etc/sysctl.conf). Un-comment the following line (by removing the # at the beginning of it) in /etc/sysctl.conf: net.ipv4.ip_forward=1 Reload the configuration: sudo sysctl -p
9: This step assumes you have ufw. Edit /etc/default/ufw and change the option DEFAULT_FORWARD_POLICY from DROP to ACCEPT
10: This step assumes you have ufw. Edit /etc/ufw/before.rules, and add the following either at the beginning of /etc/ufw/before.rules or just before the *filter rules (recommended):
# NAT table rules *nat :POSTROUTING ACCEPT [0:0] # Allow forward traffic to eth0 -A POSTROUTING -s 10.99.99.0/24 -o eth0 -j MASQUERADE # Process the NAT table rules COMMIT
11: Restart the firewall: sudo ufw disable && sudo ufw enable
Warning: If you have other ports you need open, such as for HTTPS if your server hosts a website, you need to individually add those ports to the allowed list with sudo ufw allow <PORT>
Static IP in Linux
## Configure eth0# # vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" NM_CONTROLLED="yes" ONBOOT=yes HWADDR=A4:BA:DB:37:F1:04 TYPE=Ethernet BOOTPROTO=static NAME="System eth0" UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 IPADDR=192.168.1.44 NETMASK=255.255.255.0 ## Configure Default Gateway # # vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=centos6 GATEWAY=192.168.1.1 ## Restart Network Interface # /etc/init.d/network restart ## Configure DNS Server # # vi /etc/resolv.conf nameserver 8.8.8.8 # Replace with your nameserver ip nameserver 192.168.1.1 # Replace with your nameserver ip
Mounting NFS on CENTOS
Mount NFS
yum install nfs-utils nfs-utils-lib
/etc/init.d/rpcbind start
chkconfig rpcbind on
/etc/init.d/nfslock start
chkconfig nfslock on mount source destination
Send email on reboot in linux
First, in order to have a command run on boot we can either create a reboot cron job, or add a line to the /etc/rc.d/rc.local file. Note that the crontab @reboot job may only run when the machine is rebooted, not from a cold-boot (like after the power goes out).
To use the crontab @reboot option, start by editing your crontab file and adding a line like the following (edit your crontab file with the crontab -e command):
@reboot /root/emailnotify.sh
If you instead want a script that will run every time a server is booted, add the link to your script in the /etc/rc.d/rc.local file:
#!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local /root/emailnotify.sh
Now, on reboot our server will run the /root/emailnotify.sh script!
Repo content for freepbx distro
Create a file at /etc/yum.repos.d./tushar.repo
and add the following content
------- add only content mentioned below this line -----
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://yum.freepbxdistro.org/centos/6.5/os/i386/
#baseurl=http://yum.freepbxdistro.org/shmz-os/6.5/os/x86_64/
gpgcheck=0
----- add only content mentioned above this line -----
This step is only required if above said directory is empty and you need to install additional packages.
Wanpipe installation for Sangoma cards
Sangoma Driver Installation
The following instructions will guide you through the Installation of the Sangoma Wanpipe driver on your server that contains all required software pacakges already installed(i.e. Asterisk, DAHDI, Libpri).
Download the latest official release of the Sangoma Wanpipe Driver Copy & Paste the line below into your Linux command line in /usr/src/ directory. It will automatically download the driver
wget ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-current.tgz
---
Uncompress the download wanpipe download (.tgz file) in /usr/src
tar xvfz wanpipe-current.tgz cd wanpipe-<version>/
---
To Install Wanpipe, run ./Setup install from the newly created wanpipe-<version> directory
./Setup install
** For A116 Customers: please use ./Setup install --dahdi-chunk=40 (For more info click here) You will notice the Wanpipe driver installation splash screen next. Press 'y' to continue You will be presented with a dependency check with pass/fail results. If there are any failures, you must exist and install missing dependency manually. Press [enter] to continue Press [enter] on the following screen for default kernel source location. If there are any error messages that result, that means you are missing your Linux kernel development packages. This also means that during the 'Preparing your Operating system for software packages' step above has failed to download your kernel-devel packages. If this happens you must search online for the kernel-devel packages for your kernel, then download and install using (rpm -i...)
Press [enter] to continue
Next you will be presented with 7 different options on how to install the Wanpipe driver. Select option 2 to install the Wanpipe driver for Asterisk
You will be asked to provide the location of your DAHDI software package. If you have downloaded and installed DAHDI in /usr/src/, simply press the number pertaining to the location. In the example below, Press 1. In this example, the user has dahdi version 2.7.0 installed on their system If your DAHDI installation lives in another directory, press 'm' then manually enter the full path If you have multiple DAHDI versions on your system, select the correct one. (to find out which version of dahdi is installed on your system simply type dahdi_cfg -vvv command in another Linux window) The Wanpipe driver will now start to compile on your Linux operating system. Press 'y' to proceed Press [enter] to continue Press [enter] to continue The example above is for an a108 8 port E1/T1 card continue to press [enter] as seen below press [enter] to continue You should end up with the following screen. If you see error messages, then you are missing system dependencies. continue to press [enter] when asked. Press 'y' to install Wanpipe start scripts The following screen indicates that the Wanpipe driver has completed installation on your server and is now ready to start Configuring your Sangoma hardware on your system Press 'y' to configure all Sangoma hardware installed on server. If you have installed Wanpipe to upgrade from a previous version, you must exit installation now because if you continue you will overwrite all previous configuration If you have not installed your Sangoma hardware yet, you can exit the installation, install hardware and continue by typing wancfg_dahdi command to start configuration script. *** If your Sangoma hardware was NOT detected by your system, or if the Wanpipe driver failed to install properly, the following screen will appear. error message The on-screen prompts that present next will be unique to your Sangoma hardware and specific to your telco settings. We will not show these screens here, but if you wish to see more details on what screens would show next, please visit the specific wancfg_dahdi pages for details After you have completed the configuration section of your Sangoma hardware, the following summary screen will be presented. Example from configuration of 1 analog card Select option 3 below to save and stop Asterisk & Wanpipe (if already running). Any new configuration will apply only after restarting * If you see the following screen, simply press option 2 (YES) to proceed Select option 1 to start Wanpipe on system boot. If your server ever reboots unintentionally, you will want the driver to automatically start in order to have your server back in production without manual intervention Select option 1 (YES) to have 'dahdi_cfg' run after the Wanpipe driver starts. This step configures on Wanpipe ports for dahdi You have now fully installed and configured your Sangoma Hardware for your Asterisk server! To verify that you have successfully installed the Sangoma Wanpipe driver by typing the following command in your Linux command line:
wanrouter hwprobe
You should see details of your Sangoma hardware auto-detected in your system. If you see an error message, this means the Wanpipe driver was NOT installed correctly. Please open /var/log/messages file for error details
Configuration
Configure your Asterisk System with the following: Note -> this step was offered at the end of the ./Setup dahdi, if you already configured the card skip this step and proceed to the next step
wancfg_dahdi
--- Creates Dahdi configuration files Creates wanpipe configuration files in /etc/wanpipe Creates dahdi config file in /etc/dahdi/system.conf Creates Asterisk dahdi config file in /etc/asterisk/chan_dahdi.conf
Operation
Start the Sangoma Driver (Wanpipe Ports)
wanrouter start
- starts all ports - check /var/log/messages for any errors ---
Configure DAHDI module Note: the option to have this step performed automatically was offered at the end of ./Setup dahdi. If you selected YES, then you can skip this step as it will perform automatically after "wanrouter start"
dahdi_cfg
Configures DAHDI kernel modules from /etc/dahdi/system.conf ( Previously - ztcfg ) ---
Start Asterisk
asterisk
Access the Asterisk CLI and fun some basic commands to verify your Asterisk suite is ready for production
CLI> asterisk -rv
Type the following CLI command to verify all your channels (dahdi channels) are loaded into asterisk:
CLI> dahdi show channels
If you receive an error or no output from the above command, verify chan_dahdi loaded into asterisk
CLI> module load chan_dahdi.so
If the above returns an error message check /var/log/asterisk messages ( or /var/log/asterisk/full) for the reason why Run the following command to verify if your PRI or BRI spans are UP and Active:
CLI> pri show spans
Installing Asterisk 11 on Ubuntu
For this install I am using Asterisk 11.0.1 and will be compiling from source on Ubuntu 12.04.1.
Before you begin the install process you will want to be sure that your server OS is up to date. When the update completes the server will reboot.
apt-get update && apt-get upgrade -y && reboot
Next you will want to resolve basic dependencies. (More information on Asterisk dependencies.)
apt-get install build-essential wget libssl-dev libncurses5-dev libnewt-dev libxml2-dev linux-headers-$(uname -r) libsqlite3-dev uuid-dev
Download the source tarballs. These commands will get the current version of DAHDI, libpri and Asterisk.
cd /usr/src/ wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
Extract the files from the tarballs
tar zxvf dahdi-linux-complete* tar zxvf libpri* tar zxvf asterisk*
Install DAHDI
cd /usr/src/dahdi-linux-complete* make && make install && make config
Install libpri
NOTE: libpri 1.4.13 won’t compile on Ubuntu 12.04 due to a bug (https://issues.asterisk.org/jira/browse/PRI-145). See the video for how to apply a patch to fix the bug. (Edit: libpri 1.4.14 has been released with this bug fix included. If you are a using 1.4.14 or later you should not encounter this bug.)
cd /usr/src/libpri* make && make install
Install Asterisk. Select your options when the menuselect command runs. Then select “Save & Exit” and the install will continue.
cd /usr/src/asterisk* ./configure && make menuselect && make && make install && make config && make samples
Start DAHDI
/etc/init.d/dahdi start
Start Asterisk and connect to the CLI
/etc/init.d/asterisk start asterisk -rvvv
Verify your installation by checking for the DAHDI and libpri versions on the Asterisk CLI
*CLI> dahdi show version DAHDI Version: 2.6.1 Echo Canceller: HWEC *CLI> pri show version libpri version: 1.4.13
Congratulations! You now have Asterisk 11 running on Ubuntu 12.04.
Jab hum chote bachche the badi shararat karte the...
Change hostname in CENTOS 6
Sysconfig/Network
Open the /etc/sysconfig/network file with your favorite text editor. Modify the HOSTNAME= value to match your FQDN host name.
# sudo nano /etc/sysconfig/network
HOSTNAME=myserver.domain.com
Hosts File
Change the host that is associated to your main IPaddress for your server, this is for internal networking (found at /etc/hosts):
127.0.0.1 hostname.localdomain hostname
192.168.0.1 hostname.localdomain hostname
Run Hostname
The 'hostname' command will let you change the hostname on the server that the commandline remembers, but it will not actively update all programs that are running under the old hostname.
Restart Networking
At this point all the necessary changes that needed to be made have been made, you will want to restart networking on your server to make sure that changes will be persistent on reboot:
# /etc/init.d/network restart
cannot change locale (UTF-8): No such file or directory
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
Operation System: CENTOS 6
Solution:
and make sure LC_ALL="en_US.UTF-8" is in or added to the /etc/sysconifg/i18n
example content
LANG="en_GB.UTF-8" SYSFONT="latarcyrheb-sun16" LC_ALL="en_US.UTF-8"
Wish I could buy this sometime.... damn it Rs 22000 for this???