Wednesday, July 08, 2015

CSF blank page webmin mobile on centos 7 (fixed!)

ref: https://www.vultr.com/docs/setup-csf-on-centos-7

If you having problem running csf module on webmin please install dependencies:
* notes: i'm using Epel and rpmforge repos before running this installation. worked for me.
Install the CSF dependencies.
  yum -y install wget perl unzip net-tools perl-libwww-perl perl-LWP-Protocol-https perl-GDGraph

Monday, May 11, 2015

ipv6 unifi on centos using PPPoE (final)

ref: https://www.bidon.ca/en/node/634

This is working setting for IPv6 unifi.

I uses route announcements (RA) so that the home router configures the default route as well as a /64 prefix for auto-configuration. We don't need the /64, but it can be useful for the default route.
For PPP on a router, this is disabled by default.
To enable the default route from route advertisements:
# sysctl -w net.ipv6.conf.ppp0.accept_ra=2
To auto-configure an IP address to ppp0:
# sysctl -w net.ipv6.conf.ppp0.autoconf=1
After a few seconds, "ifconfig ppp0" should show a global IPv6 address, and "ip -6 route" will show a default route. You should also be able to "ping6 google.com" or he.net from your router.
IMPORTANT: to make sysctl configurations permanent, you can try to add them to /etc/sysctl.conf, or to /etc/ppp/ipv6-up.d/my-network (script executed when the ppp connection is enabled).

Configuring the /56 prefix with DHCPv6-PD

A /64 network prefix is recommend for a single network. However, most IPv6 home topologies need more than one network. For example, the wireless access point (AP) should use its own network (bye bye network bridging), the wired network another network, another for home servers, appliances, etc.
Install the 'WIDE DHCPv6 client':
# apt-get install wide-dhcpv6-client
The Debian configuration wizard may ask for which interface to listen on: ppp0.
Sample configuration in /etc/wide-dhcpv6/dhcp6c.conf :
# c.f. http://www.ipcalypse.ca/?p=204
interface ppp0 {
  # Identity Association for Prefix Delegation
  send ia-pd 1;

  # Identity Association for Non-temporary Addresses
  send ia-na 1;

  # request domain-name-servers;
  # request domain-name;
  # script "/etc/wide-dhcpv6/dhcp6c-script";
};

id-assoc pd 1 {
  prefix-interface eth1 {
    # Assign subnet 1 to eth1
    sla-id 1;

    # IP address "postfix". if not set it will use EUI-64 address of the interface.
    # Combined with SLA-ID'd prefix to create full IP address of interface.
    ifid 1;

    # Prefix bits assigned.
    # Take the prefix size you're assigned (/48 or /56) and subtract it from 64.
    # In my case I was being assigned a /56, so 64-56=8
    sla-len 8;
  };
};

id-assoc na 1 {
};
Test from the command line:
# dhcp6c -fD -c /etc/wide-dhcpv6/dhcp6c.conf ppp0

Configure radvd for auto-configuration on the networks

Each network with clients (desktops/workstations/laptops) will need radvd so that the clients can auto-configure themselves.
Install radvd:
# apt-get install radvd
Example configuration for a subnet, in /etc/radvd.conf :
interface eth1
{
  AdvSendAdvert on;
  MaxRtrAdvInterval 30;

  prefix ::/64
  {
    AdvOnLink on;
    AdvAutonomous on;
    AdvRouterAddr off;
    AdvValidLifetime 300;
    AdvPreferredLifetime 120;
  };
};
Then restart radvd:
# services radvd restart

Tuesday, May 05, 2015

Enable ipv6 on centos PPPoE unifi

ref: http://wandin.net/dotclear/index.php?post/2011/02/10/Native-IPv6-with-Internode-and-CentOS

Note: you will need new BTU from unifi technician that support ipv6. old btu does not support ipv6 at my place.

remember to put ipv6[space],


# vi /etc/ppp/options 
lock
ipv6 ,
May  5 15:24:46 backup pppd[15296]: PAP authentication succeeded
May  5 15:24:46 backup pppd[15296]: local  LL address fe80::78e0:xxxx:xxxx:xxxx
May  5 15:24:46 backup pppd[15296]: remote LL address fe80::2a6e::xxxx:xxxx:xxx
May  5 15:24:46 backup pppd[15296]: local  IP address 175.143.xx.xx
May  5 15:24:46 backup pppd[15296]: remote IP address 175.143.xx.xx

Wednesday, April 01, 2015

HWAWEI e373 centos 6 id

Bus 006 Device 013: ID 12d1:140c Huawei Technologies Co., Ltd. E180v

this is my working ID for E373. store for future reference.

Monday, January 26, 2015

automated telegram reply with centos

searching and i found this:
to send message:
http://stackoverflow.com/questions/24330922/sending-messages-with-telegram-apis-or-cli

to reply message:
http://stackoverflow.com/questions/27671801/pass-string-to-a-linux-cli-interactive-program-with-a-script
http://www.instructables.com/id/Raspberry-remote-control-with-Telegram/

First create a bash script for telegram called tg.sh:
#!/bin/bash
now=$(date)
to=$1
subject=$2
body=$3
tgpath=/home/youruser/tg
LOGFILE="/home/youruser/tg.log"
cd ${tgpath}
${tgpath}/telegram -k ${tgpath}/tg-server.pub -W <<EOF
msg $to $subject
safe_quit
EOF
echo "$now Recipient=$to Message=$subject" >> ${LOGFILE}
echo "Finished" >> ${LOGFILE}


To intercept a new incoming message we create a file action.lua
"Lua is a powerful, fast, lightweight, embeddable scripting language.
Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping."
sudo nano /home/pi/tg/action.lua
with this content
function on_msg_receive (msg)
    if msg.out then
        return
    end
    if (msg.text=='ping') then
        send_msg (msg.from.print_name, 'pong', ok_cb, false)
    end
end

function on_our_id (id)
end

function on_secret_chat_created (peer)
end

function on_user_update (user)
end

function on_chat_update (user)
end

function on_get_difference_end ()
end

function on_binlog_replay_end ()
end
Save and exit, when incoming text message is "ping", Telegram answers us with a text message containing "pong".
move in tg

cd /home/pi/tg
Then type
bin/telegram-cli -k tg-server.pub -W -s action.lua

Tuesday, January 20, 2015

sms gateway update (1)

link: http://nerazan.blogspot.com/2013/07/how-to-configure-gsm-modem-in-linux.html
(previously working but now not working. wondering why.

http://everyday-tech.com/nagiosfan-sms-alerts-via-smstools/

Download & Install CMake for CentOS-5

Install GCC

Install eject

Install comget

.
Configuring Your GSM Modem

1.)  Insert gsm modem in usb port
2.)  Run

3.)
 Check which modem Port it’s connected to

4.)
 Eject the Cd-rom sro & sr1 as per your setup

5.)
 Connect gsm modem to usb port ( USB0 in my case )

6.)
 When the modem is connected you will get a message with your service provider name
7.)  Create symbolic link to /dev/modem

TO TEST THAT THE USB MODEM IS ON USB0

.

Installing & Configuring SMSTools


1.)  Install SMS Tools
-or-

2.)  Make Sure you have the Following SMSTOOLS3 SERVER Files and Folders Installed
  • incoming = /var/spool/sms/incoming
  • outgoing = /var/spool/sms/outgoing
  • checked = /var/spool/sms/checked
  • failed = /var/spool/sms/failed
  • sent = /var/spool/sms/sent
  • logfile = /var/log/smsd.log
  • Configuration = /etc/smsd.conf

3.)  Make sure that SMSTools has the Right Configuration Setting for your modem in:  /etc/smsd.conf( GSM Modem is on USB0 in this example)
device = /dev/ttyUSB0

HOW TO START or STOP THE SMSTOOLS3 SERVER

To Setup SMS Tools to AutoStart on Server Boot….

To Test your SMSTools Install:
Related Posts Plugin for WordPress, Blogger...