Quantcast
Image

Search Results for: all

How to auto-complete JavaScript syntax in Vim

By  •  May 28, 2018

JavaScript is the scripting language for the web. Vim in the other hand is the editor of choice for many programmers. Being feature-rich, Vim is able to auto-complete JavaScript syntaxes. To use the feature, you’ll need to enable it first.

Enter the following while in Vim’s command mode to enable the feature.

:set omnifunc=javascriptcomplete#CompleteJS

You can now auto-complete JavaScript syntaxes by pressing Ctrl + x followed by Ctrl + o while partially typing JavaScript codes.

The following is a sample screenshot.

You can use the arrow key to navigate through the list to choose your desired auto-complete suggestion.

Where is the best position for AdSense

By  •  May 28, 2018

There’s no single solution when it comes to positioning your AdSense ads. The best place to position your AdSense ads is where the visitor’s attention is focused, and visitors interact with every site differently, depending on the type of site and how the navigation and features is arranged.

In general, there are some areas in a web page that visitor’s eyes and attention is focused to more than the other. By compiling and analyzing the data of visitor’s behaviour, Google itself came up with the following “heat map”.

While the heat map above was provided by Google for AdSense unit placements, it’s also applicable to any other PPC or affiliate ads. The heat map suggest that the darker the area, more likely it is for visitors to look at your ads, and the better your ads will perform.

From the diagram we can tell that the best performing ads are normally the one placed just before the main content of the site, and followed by other “above the fold” locations and the left sidebar.

Do keep in mind though, though this is how it generally works for most websites, it might work differently for you. The general rule is, place it where your site’s visitor’s are focused to, and that could always mean near your site’s content; which could be some widgets you have, article body, Youtube video, so on and so forth. Whatever it is, keep experimenting till you find the right spot. Also keep in mind to not overdo with your ad placement, and try to keep your site clean, uncluttered, and inviting.

How to configure glusterfs in CentOS / Red Hat

By  •  May 28, 2018
yum install centos-release-gluster
yum install glusterfs gluster-cli glusterfs-libs glusterfs-server
vi /etc/hosts
mkfs.xfs /dev/cl/export_glusterexport
mount /dev/cl/export_glusterexport /export/glusterexport/
umount /export/glusterexport/
mkfs.xfs -f /dev/cl/export_glusterexport
systemctl enable glusterd.service
vi /etc/fstab
mount -a
lsblk
systemctl enable glusterd.service
systemctl start glusterd.service
firewall-cmd --zone=public --add-port=24007-24008/tcp --permanent
firewall-cmd --reload
gluster peer probe glusterserver2
gluster peer status
firewall-cmd --zone=public --add-port=24009/tcp --permanent
firewall-cmd --reload
cd /export/glusterexport/
lvrename cl export_glusterexport glusterfs
vi /etc/fstab
lvrename cl glusterfs export_glusterfs
mkdir glusterfs/glusterexport
gluster peer probe glusterserver2
gluster peer status
gluster volume create glusterexport replica 2 transport tcp glusterserver1:/export/glusterfs/glusterexport glusterserver2:/export/glusterfs/glusterexport
gluster volume start glusterexport
gluster volume info all
showmount -e 127.0.0.1
mount -t nfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport
mount -t glusterfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport
firewall-cmd --zone=public --add-service=nfs --add-service=samba --add-service=samba-client --permanent
firewall-cmd --zone=public --add-port=111/tcp --add-port=139/tcp --add-port=445/tcp --add-port=965/tcp --add-port=2049/tcp --add-port=38465-38469/tcp --add-port=631/tcp --add-port=111/udp --add-port=963/udp --add-port=49152-49251/tcp  --permanent
firewall-cmd --reload
mount -t glusterfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport/
mount -t glusterfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport/
tail /var/log/glusterfs/export-glusterexport.log
mount -t nfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport/
mount -t nfs 127.0.0.1:/export/glusterfs/glusterexport /export/glusterexport/
gluster volume info all
mount -t glusterfs 127.0.0.1:glusterexport /export/glusterexport/
ll glusterexport/
cd glusterexport/
gluster volume info all
gluster volume info glusterexport
showmount -e 127.0.01
systemctl restart nfs-server
gluster volume info all
gluster peer status
gluster volume info all
systemctl restart glusterfs

How to list files recursively in Linux

By  •  May 28, 2018

The command used to list directory content in Linux is ls. With the -R option, ls will traverse the directory recursively, showing the content of the particular directory and all its subdirectories. Relative directory path is displayed before the directory content is actually listed.

The following is an example of the command in use;

$ ls -R testdir/
testdir/:
subdir1  subdir2

testdir/subdir1:
subsubdir1  subsubdir2

testdir/subdir1/subsubdir1:
file1

testdir/subdir1/subsubdir2:
file2

testdir/subdir2:
subsubdir1  subsubdir2

testdir/subdir2/subsubdir1:
file3

testdir/subdir2/subsubdir2:
file4

How to increase direct traffic to your website

By  •  May 28, 2018

Direct traffic is the type of website traffic where visitors come to your website directly, without being referred to by search engines or other websites. This type of website traffic also includes personal bookmarks and RSS feeds. Most webmaster pay less attention to direct traffic when running a campaign to increase their overall website’s traffic.

Direct traffic visitor is one of the most important type of visitor your website could get. To have specifically chosen to visit your website, it is the most targeted type of website traffic. Direct traffic visitors are also not affected by outside factors such as when there are changes in search engine ranking. They also respond well to you website’s offering, and tend to promote your website or content more than the other type of website traffic shall they find anything useful.

How to add new users in Kubuntu / KDE

By  •  May 28, 2018

You can add new users in Kubuntu via graphical user interface from within the System Settings. This is basically the same for other KDE-based Linux distributions such as openSUSE as Kubuntu itself is based on KDE.

Follow these steps to add new users in Kubuntu and KDE in general;

  1. Open System Settings by going to ComputerApplications in the start menu.
  2. Click on Account Details in the Personalization section.
  3. Click on User Manager on the left navigation tab.
  4. Click on New User.
  5. Fill in details such as the username and Real Name.
  6. A window will popup upon clicking the Password field.
  7. Enter a complex-enough password till This password is good text appears and click Ok.
  8. Tick on the Administrator checkbox if you want to allow sudo or administrator access for the user and on the Automatic Login checkbox if you want the system to automatically login to this user upon boot-up and click Apply.
  9. Enter your password to authenticate to the system.

    This require your user to have administrator privilege in the system.


  10. Your new user creation is now complete.

How to configure Huawei E1552 in Ubuntu Linux

By  •  May 28, 2018

Huawei E1552 is a HSDPA USB Stick capable of delivering HSDPA connectivity at up to 3.6Mbps. Being a USB stick cum modem cause some problem with Ubuntu (and Linux general), but is easily fixable by the following method.

How to restart SSH service

By  •  May 28, 2018

Ubuntu 16.10 and later, RedHat/CentOS 7 and later, fedora and other platform with systemd

sudo systemctl restart sshd.service

Older platforms with System V init scripts

sudo /etc/init.d/sshd restart

Platforms with service command. Normally a wrapper to System V init scripts or systemd commands.

sudo service ssh restart

How to increase GMail storage

By  •  May 28, 2018

Even though Google is currently providing almost 8GB of storage (and counting) for its GMail user, some might not find it enough for their use. Fret not, as Google provides additional storage for those willing to pay for it

How to restart Apache service

By  •  May 28, 2018

There are many ways to restart Apache service and this depends on your platform of choice and personal preferences

Platform Command
Ubuntu 16.10 and later, RedHat/CentOS 7 and later, Fedora and other platform with systemd
# systemctl restart httpd.service
Platforms with service command. Normally a wrapper to System V init scripts or systemd commands.
# service httpd restart
Older platforms with System V init scripts
# /etc/init.d/apache2 restart
Apache’s built-in command
# httpd -k restart

Different platform might use different binary/script names such as apache, apache2, apachectl or apache2ctl

Top
OnlineWebTools