All posts by ServerAdmin

Cx UI framework

If you’re working on a new admin and dashboard application and you’re looking for a quality UI framework which is fast and easy to use, check the Cx. It is inspired by React, Redux, Ext JS, Angular and other open-source libraries and frameworks, but as they said, it tries to cover all you need for a modern web app.

During the promo period, you can buy it with 50% discount (coupon code: LAUNCH-PARTY). For more information, please visit the official page – https://cx.codaxy.com/.

cx-starter

Command line system information

If you’re not sure which components are installed in your server/pc, you can use inxi which is a command line system information script. It will show you the system hardware, CPU, drivers, Xorg, Desktop, Kernel, GCC version(s), Processes, RAM usage, and a wide variety of other useful information.

For example:

myPC@myPC ~ $ inxi -F
System:    Host: myPC Kernel: 3.19.0-32-generic x86_64 (64 bit) Desktop: Cinnamon 2.8.8
           Distro: Linux Mint 17.3 Rosa
Machine:   System: LENOVO product: 20E1000BSC v: ThinkPad W550s
           Mobo: LENOVO model: 20E1000BSC v: SDK0E50510 WIN Bios: LENOVO v: N11ET34W (1.10 ) date: 08/20/2015
CPU:       Dual core Intel Core i7-5600U (-HT-MCP-) cache: 4096 KB 
           clock speeds: max: 3200 MHz 1: 901 MHz 2: 981 MHz 3: 2195 MHz 4: 2199 MHz
Graphics:  Card-1: Intel Broadwell-U Integrated Graphics
           Card-2: NVIDIA GM108GLM [Quadro K620M]
           Display Server: X.Org 1.17.1 drivers: nvidia (unloaded: intel)
           Resolution: 1920x1080@59.9hz, 1920x1080@60.0hz
           GLX Renderer: Quadro K620M/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 352.63
Audio:     Card-1 Intel Wildcat Point-LP High Definition Audio Controller driver: snd_hda_intel
           Card-2 Intel Broadwell-U Audio Controller driver: snd_hda_intel
           Sound: Advanced Linux Sound Architecture v: k3.19.0-32-generic
Network:   Card-1: Intel Ethernet Connection (3) I218-LM driver: e1000e
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 54:ee:75:cc:11:4a
           Card-2: Intel Wireless 7265 driver: iwlwifi
           IF: wlan0 state: up mac: 18:5e:0f:ee:f8:aa
Drives:    HDD Total Size: 768.2GB (17.1% used) ID-1: /dev/sda model: LITEON_LCH size: 512.1GB
           ID-2: /dev/sdb model: ADATA_SP600NS34 size: 256.1GB
Partition: ID-1: / size: 28G used: 9.4G (37%) fs: ext4 dev: /dev/sdb1
           ID-2: /home size: 195G used: 60G (33%) fs: ext4 dev: /dev/sdb3
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 50.0C mobo: N/A gpu: 48C
           Fan Speeds (in rpm): cpu: 2466
Info:      Processes: 229 Uptime: 1:09 Memory: 2341.5/15748.3MB Client: Shell (bash) inxi: 2.2.28

Install FreeRADIUS – talloc library not found

In case you’re trying to install FreeRadius 3 on the latest CentOS (currently 6.8), there is a chance you’ll see the next error

...
checking for _talloc in -ltalloc in /opt/lib... no
configure: WARNING: talloc library not found. Use --with-talloc-lib-dir=<path>.
configure: error: FreeRADIUS requires libtalloc
...

To fix this problem, simple install libtalloc-devel package with

yum install libtalloc-devel

Disable bluetooth on startup – howto

I’m using Mint Linux and I noticed that the Bluetooth adapter is always on (I turned it off in the previous  session). I’m using Bluetooth from time to time, but I don’t like to see it on when I don’t need it. Besides, it wastes battery.

You can turn it off per session (as I did), but next time it’s right back on which annoys me.  As I can see, I’m not the only one who is affected with this.

The solution is set InitiallyPowered parameter to false.

sudo nano /etc/bluetooth/main.conf

Search for the entry:

InitiallyPowered = true

and change the value to:

InitiallyPowered = false

Next time you boot, it should be down.

In case this doesn’t help, try to turn off bluetooth service by adding “/etc/init.d/bluetooth stop” inside /etc/rc.local file (before the “exit 0” line)

Fix “Failed To Fetch” Apt error Howto

Google announced plans to discontinue 32-bit Google Chrome for Linux and it has. On some 64bit Ubuntu based systems (Mint/Kubuntu/Xubuntu,..), during update process you may notice the next error:

“Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release Unable to find expected entry ‘main/binary-i386/Packages’ in Release file (Wrong sources.list entry or malformed file)”

To fix this error you’ll need to make some changes in google-chrome.list

Open /etc/apt/sources.list.d/google-chrome.list file and add [arch=amd64] before “http”

deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main

Do not edit or replace any other text in this file. Save the changes and refresh your package list with

sudo apt-get update

The “failed to fetch” APT error should no longer appear

Hacked Linux Mint ISOs

Bad news for Mint users who downloaded ISO files few days ago (20th Feb)…

Some dude found the way to replace the official Mint 17.3 Cinnamon ISOs with the cracked ISOs (with backdoor inside)

More details can be found here: http://blog.linuxmint.com/?p=2994

Also, as Clem announced, the forum database was compromised and you should change your password on all sensitive websites as soon as possible (in case you used the same password on other sites)

More details: http://blog.linuxmint.com/?p=3001

Unable to export database in MySQL Workbench – delayed-insert error

In case you’re using MySQL Workbench for creating dumps please keep in mind that version 6.3.5 has one annoying bug.
After update, the first time I tried do create dump, the complete process failed with the next error:

...
mysqldump: [ERROR] unknown variable 'delayed-insert=FALSE'
...

As I can see, this error occurs on various systems (Windows / MAC / Linux) and it was fixed once (6.1.x was also affected – LINK)

For now, you can only apply temporarily fix:

Open file (as root) wb_admin_export_options.py (located in /usr/lib/mysql-workbench/modules for Ubuntu/Mint/Debian distros)

Find the line

"delayed-insert":["Write INSERT DELAYED statements rather than..."

and insert # at the begin of this line (to comment it out)
Save file and restart Workbench. Check the Advanced option and note that this option is not available

Note: Windows users
For 32bit systems, wb_admin_export_options.py is located in C:\Program Files\MySQL\MySQL Workbench XXX\modules
For x64 systems, wb_admin_export_options.py is located in C:\Program Files (x86)\MySQL\MySQL Workbench XXX\modules)

The bug fix is easy to apply but it was announced months ago we’re still waiting for update… So shame…

More info:
http://stackoverflow.com/questions/20128223/export-data-from-mysql-workbench-6-0
https://bugs.mysql.com/bug.php?id=72312

Quick Laravel – Part 1

Laravel 5.x requires PHP version 5.5.9+. Also, in case you want to use database (sqlite or mysql), install Sqlite3, Mysql or PostgreSQL server.

Install composer with

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Install Laravel (option 1)

composer create-project laravel/laravel laravel-test

Instal Laravel (option 2)

composer global require "laravel/installer=~1.1"

Add the following to .bashrc file

export PATH="~/.composer/vendor/bin:$PATH"

at the end of the file then in terminal type

source ~/.bashrc

and verify that $PATH variable contains the full path to laravel executable.

Then create new Laravel project with

laravel new laravel-test

Test installation

cd laravel-test
php -S localhost:8888 -t public

and open http://localhost:8888 in your web browser

CentOS PPTP client Howto

The Point-to-Point Tunneling Protocol (PPTP) is a method for implementing virtual private networks. Since it is marked as non secure and vulnerable, I don’t recommend it as a “final” VPN solution. The main reason for its popularity is probably the native MS Windows support (since win 95). Also, it can be easily implemented with Mikrotik RouterOS (like I said, use it for internal VPNs only).

To set up your CentOS box as a PPTP clients you’ll need the pptp package.

yum -y pptp

Open /etc/ppp/chap-secrets and add the next line (at the end). Also, replace the userName and password with the correct details:

userName PPTP password *

Create profile file

nano /etc/ppp/peers/myVPN

and paste the next content (replace IP_OR_HOSTNAME with PPTP server IP or hostname)

pty "pptp IP_OR_HOSTNAME --nolaunchpppd"
name userName
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam myVPN

save the file and test the connection with

pppd call myVPN

ifconfig should return something like

....
ppp0      Link encap:Point-to-Point Protocol  
          inet addr:10.16.18.252  P-t-P:10.16.18.251  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1436  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:2192 (2.1 KiB)  TX bytes:631 (631.0 b)
...

also in /var/log/messages you should see something like

Jul 20 10:58:50 mysrv pppd[9352]: pppd 2.4.5 started by root, uid 0
Jul 20 10:58:50 mysrv pppd[9352]: Using interface ppp0
Jul 20 10:58:50 mysrv pppd[9352]: Connect: ppp0 <--> /dev/pts/1
Jul 20 10:58:50 mysrv pptp[9353]: anon log[main:pptp.c:314]: The synchronous pptp option is NOT activated
Jul 20 10:58:50 mysrv pptp[9361]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
Jul 20 10:58:50 mysrv pptp[9361]: anon log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Jul 20 10:58:50 mysrv pptp[9361]: anon log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Jul 20 10:58:51 mysrv pptp[9361]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Jul 20 10:58:51 mysrv pptp[9361]: anon log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Jul 20 10:58:51 mysrv pptp[9361]: anon log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 716).
Jul 20 10:58:51 mysrv pppd[9352]: CHAP authentication succeeded
Jul 20 10:58:51 mysrv pppd[9352]: MPPE 128-bit stateless compression enabled
Jul 20 10:58:51 mysrv pppd[9352]: local  IP address 10.16.18.252
Jul 20 10:58:51 mysrv pppd[9352]: remote IP address 10.16.18.251
Jul 20 10:59:51 mysrv pptp[9361]: anon log[logecho:pptp_ctrl.c:677]: Echo Reply received.

If you check your routes, you’ll probably notice that ppp0 connection is not used by any route(s). This is default behavior and you can easily switch/add default route with:

route add default dev ppp0

In my case, I don’t want to route the complete traffic (this VPN is just for management) so I’ll add only one static route

route add -net 192.168.120.0/24 dev ppp0

To start this connection on boot, add “pppd call myVPN” in rc.local.