Start or Stop Linux Service

Start a service:

sudo service apache2 start

or

sudo /etc/init.d/apache2 start

Stop a service:

sudo service apache2 stop

or

sudo /etc/init.d/apache2 stop

sftp and ssh with nautilus

1. Open nautilus

2. Press ctrl + l

3. type

sftp://username@myserver.com

or

ssh://username@myserver.com

4. Enter your password

5. enjoy!

Introduction to Apt

All of these commands must be run as root or with superuser privileges.

Installation

apt-get install package_name

or

apt-get install package_name1 package_name2 package_name3
apt-get build-dep package_name

This command searches the repositories and installs the build dependencies for package_name.

Maintenance

apt-get update

Run this command periodically to make sure your source list is up-to-date or after changing sources list.

apt-get upgrade

This command upgrades all installed packages.

apt-get dist-upgrade

The same as the above, except add the “smart upgrade” checkbox. It tells APT to use “smart” conflict resolution system,
and it will attempt to upgrade the most important packages at the expense of less important ones if necessary.

apt-get check

It does an update of the package lists and checks for broken dependencies.

apt-get -f install

Do this if you get complaints about packages with “unmet dependences”.

apt-get autoclean

This command removes .deb files for packages that are no longer installed on your system.

apt-get clean

The same as above, except it removes all packages from the package cache. This may not be desirable if you have a
slow internet connection, since it will cause you to re-download any packages you need to install a program.

Removal

apt-get remove package_name

This command removes an installed package, leaving configuration files intact.

apt-get purge package_name

This command completely removes a package and the associated configuration files.

apt-get autoremove

This command removes packages that were installed by other packages and are no longer needed.

Search

apt-cache search search_term

This command will find packages that include search_term.

apt-cache show package_name

This command shows the description of package package_name.
and other relevant information including version, size, dependencies and conflicts.

dlocate package_name

This command determines which installed package owns package_name.

For more information please visit https://help.ubuntu.com/community/AptGet/Howto

List all Windows users & groups for the local machine

List users

NET USERS

 
List groups

NET LOCALGROUP

 
Accounts Policy Information

NET ACCOUNTS

 

Set PHP configuration options in Apache using directives

Apache directives to change the PHP configuration:
php_value name value

Sets the value of the specified directive.

php_flag name on|off

Sets a boolean configuration directive.

php_admin_value name value

Sets the value of the specified directive. This can not be used in .htaccess files.

php_admin_flag name on|off

Used to set a boolean configuration directive. This can not be used in .htaccess files.

Let’s see some examples:

<IfModule mod_php5.c>
  php_value include_path ".:/usr/local/lib/php"
  php_admin_flag engine on
</IfModule>
<Directory /var/www/vhosts/mydomain.com/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/httpdocs:/var/www/vhosts/mydomain.com/files"
</Directory>
<Directory /var/www/vhosts/mydomain.com/httpdocs>
php_value  include_path         ".:/usr/local/lib/php" 
php_flag   display_errors       Off
php_value  upload_max_filesize  2M
</Directory>

Install development tools and kernel headers for Fedora

Development Tools Installation

yum groupinstall 'Development Tools'

Kernel headers Installation

yum install kernel-devel kernel-headers

or

yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r)

CentOS SSH Server Installation

You need to install the following package:

su -
yum -y install openssh-server

Start the service

chkconfig sshd on
service sshd start

Remote Desktop Support in CentOS

Remote Desktop Support

Become root

su -

Installation

yum install vino

Setting up Remote Desktop Access

Goto System->Preferences->Remote Desktop
and enable these settings on the remote desktop window preferences:
1. Allow other users to view your desktop.
2. Allow other users to control your desktop.
3. Require the user to enter this password: your_password
4. Configure network automatically to accept connections.

How do I find out the MAC address of my Linux system?

I know that is something common but people keep questioning me about how to get the ethernet mac address on their linux system. So, here it is. Issue the following command:

ifconfig eth0 | grep HWaddr

QR code

QR Code (Quick Response Code) is two dimensional code which is categorized in matrix code. The code consists of black modules arranged in a square pattern on a white background. The information encoded can be made up of four standardized kinds of data (numeric, alphanumeric, byte/binary, Kanji). The QR Code was designed for high speed reading, high capacity, high density, error correcting, structured append and high speed decoding.

 

Standards

  • October 1997 – AIM (Association for Automatic Identification and Mobility) International
  • January 1999 – JIS X 0510
  • June 2000 – ISO/IEC 18004:2000 Information technology – Automatic identification and data capture techniques – Bar code symbology – QR code
  • 1 September 2006 – ISO/IEC 18004:2006 Information technology – Automatic identification and data capture techniques – QR Code 2005 bar code symbology specification

 

Storage

The amount of data that can be stored in the QR Code symbol depends on the datatype and error correction level. The maximum storage capacities are as follows:

Numeric only Max. 7,089 characters (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
Alphanumeric Max. 4,296 characters (0–9, A–Z [upper-case only], space, $, %, *, +, -, ., /, :)
Binary/byte Max. 2,953 characters (8-bit bytes) (23624 bits)
Kanji/Kana Max. 1,817 characters

 

Encryption

There are a few implementations. An Android app manages encryption and decryption of QR codes using DES algorithm. Japanese immigration use encrypted QR Codes when placing visas in passports.

 

Error Correction

Level L 7% of codewords can be restored.
Level M 15% of codewords can be restored.
Level Q 25% of codewords can be restored.
Level H 30% of codewords can be restored.

 

License

The use of QR Codes is free of any license. The QR Code is clearly defined and published as an ISO standard.

Image is from wikipedia.

Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress