[root@app1 ~]# lpq
SPDDCNPH09 is ready
no entries
[root@app1 ~]# lpstat -o
SPLDPHCA02-1994129 applprod 2048 Wed 18 Jan 2017 11:24:54 AM GST
DPDDCNPH03-1994219 applprod 2048 Wed 18 Jan 2017 11:28:03 AM GST
NWADCNPH20-1994345 applprod 2048 Wed 18 Jan 2017 11:33:39 AM GST
KHADCNPH03-1994530 applprod 2048 Wed 18 Jan 2017 11:41:02 AM GST
SPLDIPPH01-1994538 applprod 2048 Wed 18 Jan 2017 11:42:32 AM GST
SPLDCNPH10-1994642 applprod 2048 Wed 18 Jan 2017 11:46:41 AM GST
[root@app1 ~]# cancel -a
[root@app1 ~]# cancel 1994129
cancel: cancel-job failed: Job #1994129 does not exist!
[root@app1 ~]# lpstat -o
HPDDCNPH06-1994947 applprod 2048 Wed 18 Jan 2017 12:00:42 PM GST
[root@app1 ~]# cancel 1994947
…………………………………………………………..
lpstat -o #to view outstanding print jobs.
cancel -a {printer} # To cancel ALL jobs or …
cancel {printerjobid} # To cancel 1 job.
Category Archives: General
CUPS Printer configuration on Linux
#ssh Y.Y.Y.Y
#yum install cups
#yum list cups
#mv printers.conf printers.conf_orig #command to take printers.conf backup
#scp X.X.X.X:/etc/cups/printers.conf .
#/etc/init.d/cups restart
#yum install firefox
#scp X.X.X.X:/etc/cups/ppd/* ppd/ #This command to copy existing cups configuration or we can add new printers manually.
How to disable IPV6 on Linux
Method 1:
# echo ‘1’ > /proc/sys/net/ipv6/conf/lo/disable_ipv6
# echo ‘1’ > /proc/sys/net/ipv6/conf/lo/disable_ipv6
# echo ‘1’ > /proc/sys/net/ipv6/conf/all/disable_ipv6
# echo ‘1’ > /proc/sys/net/ipv6/conf/default/disable_ipv6
# /etc/init.d/networking restart
Method 2:
#vi /etc/sysctl.conf
# IPv6 disabled #add these 3 lines in the last
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
# /etc/init.d/networking restart
Method 3 : Disable ipv6 from GRUB
Ipv6 can also be disabled by editing the grub configuration file
$ sudo gedit /etc/default/grub
GRUB_CMDLINE_LINUX=”ipv6.disable=1″
# /etc/init.d/networking restart
Start the MySQL server fails
Start the MySQL server fails, as follows:
[root@spark01 ~]# /etc/init.d/mysqld start
Starting mysqld (via systemctl): Job for mysqld.service failed because the control process exited with error code. See “systemctl status mysqld.service” and “journalctl -xe” for details.
[FAILED]
When prompted, respectively, using systemctl status mysqld.service and journalctl -xe see why the service failed to start
[root@spark01 ~]# systemctl status mysqld.service
?.mysqld.service – SYSV: MySQL database server.
Loaded: loaded (/etc/rc.d/init.d/mysqld)
Active: failed (Result: exit-code) since Wed 2016-01-20 18:26:57 CST; 40s ago
Docs: man:systemd-sysv-generator(8)
Process: 2979 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=1/FAILURE)
Jan 20 18:26:56 spark01 systemd[1]: Starting SYSV: MySQL database server….
Jan 20 18:26:57 spark01 mysqld[2979]: MySQL Daemon failed to start.
Jan 20 18:26:57 spark01 mysqld[2979]: Starting mysqld: [FAILED]
Jan 20 18:26:57 spark01 systemd[1]: mysqld.service: control process exited, code=exited status=1
Jan 20 18:26:57 spark01 systemd[1]: Failed to start SYSV: MySQL database server..
Jan 20 18:26:57 spark01 systemd[1]: Unit mysqld.service entered failed state.
Jan 20 18:26:57 spark01 systemd[1]: mysqld.service failed.
[Root @ spark01 ~] # journalctl truck
— Unit session-2.scope has begun starting up.
Jan 20 18:26:48 spark01 sshd[2916]: pam_unix(sshd:session): session opened for user spark by (uid=0)
Jan 20 18:26:52 spark01 su[2944]: (to root) spark on pts/1
Jan 20 18:26:52 spark01 su[2944]: pam_unix(su-l:session): session opened for user root by spark(uid=1000)
Jan 20 18:26:56 spark01 polkitd[909]: Registered Authentication Agent for unix-process:2974:117137 (system bus name :1.25
Jan 20 18:26:56 spark01 systemd[1]: Starting SYSV: MySQL database server….
— Subject: Unit mysqld.service has begun start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit mysqld.service has begun starting up.
Jan 20 18:26:57 spark01 mysqld[2979]: MySQL Daemon failed to start.
Jan 20 18:26:57 spark01 mysqld[2979]: Starting mysqld: [FAILED]
Jan 20 18:26:57 spark01 systemd[1]: mysqld.service: control process exited, code=exited status=1
Jan 20 18:26:57 spark01 systemd[1]: Failed to start SYSV: MySQL database server..
— Subject: Unit mysqld.service has failed
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit mysqld.service has failed.
—
— The result is failed.
Jan 20 18:26:57 spark01 systemd[1]: Unit mysqld.service entered failed state.
Jan 20 18:26:57 spark01 systemd[1]: mysqld.service failed.
Jan 20 18:26:57 spark01 polkitd[909]: Unregistered Authentication Agent for unix-process:2974:117137 (system bus name :1.
However, when unfortunately, this information does not provide the real reason for the service failed to start.
At this time, it may open the MySQL alarm log, after all, as long as the MySQL service starts, there will be alarm log output information, and sure enough
2016-01-20T10:00:19.935771Z 0 [ERROR] /usr/sbin/mysqld: Can’t create/write to file ‘/var/run/mysqld/mysqld.pid’ (Errcode: 2 – No such file or directory)
2016-01-20T10:00:19.935795Z 0 [ERROR] Can’t start server: can’t create PID file: No such file or directory
160120 18:00:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
MySQL service at boot time, you can not create pid file.
In the end look at the directory exists, it really does not exist.
Then, create a / var / run / mysqld / directory, and restart the MySQL service
[root@spark01 ~]# mkdir -p /var/run/mysqld/
[root@spark01 ~]# /etc/init.d/mysqld start
Starting mysqld (via systemctl): Job for mysqld.service failed because the control process exited with error code. See “systemctl status mysqld.service” and “journalctl -xe” for details.
Still being given to re-view the alarm log, the following output
2016-01-20T10:28:37.183387Z 0 [ERROR] /usr/sbin/mysqld: Can’t create/write to file ‘/var/run/mysqld/mysqld.pid’ (Errcode: 13 – Permission denied)
2016-01-20T10:28:37.183431Z 0 [ERROR] Can’t start server: can’t create PID file: Permission denied
160120 18:28:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
160120 18:32:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
The original, / var / run / mysqld / or of the owner and group root, mysql and which can not create a file, the owner and the modified directory is a group, started OK.
[root@spark01 ~]# ls -ld /var/run/mysqld/
drwxr-xr-x 2 root root 40 Jan 20 18:28 /var/run/mysqld/
[root@spark01 ~]# chown mysql.mysql /var/run/mysqld/
[root@spark01 ~]# /etc/init.d/mysqld start
Starting mysqld (via systemctl): [ OK ]
How to Install SVN Server on Ubuntu 14.04
Here the easiest way to Install SVN Server on Ubuntu 14.04 and test with client.
In this post we will install SVN Server on Ubuntu 14.04 and Apache/2.4.7 are used. The client used is Tortoise for Windows.
INSTALL SVN SERVER IN UBUNTU
Execute the following commands to update the Ubuntu repository list and install apache + svn.
sudo apt-get update
sudo apt-get install subversion apache2 libapache2-svn apache2-utils
*If asked type Y (Yes). If you have trouble updating check your internet connection, proxy, try update fix-missing etc.
Create your repository folder in this case /svn/repos/
sudo mkdir -p /svn/repos/
Create your repository in SVN
sudo svnadmin create /svn/repos/myrepo
Give permisions to apache to access your newly created folder.
sudo chown -R www-data:www-data /svn/repos/myrepo
Create a apache configuration file for the repository. (Use your favorite ubuntu editor, nano, vi, etc)
In this example in folder /etc/apache2/sites-available a file named myrepo-svnrepo.conf is created
sudo vi /etc/apache2/sites-available/myrepo-svnrepo.conf
DAV svn
SVNParentPath /svn/repos/
SVNListParentPath On
AuthType Basic
AuthName “Repositorio Subversion del proyecto”
AuthUserFile /etc/svnpasswd
Require valid-user
*If you used vi exit and save pressing ESC :wq!
Activate repository
sudo a2ensite myrepo-svnrepo
Restart Apache
sudo service apache2 reload
Create your first user
sudo htpasswd -cm /etc/svnpasswd user1
*Now you will be asked to intro a password for the new user
CAUTION: If you execute this command again (-c) all users will be removed.
To create more users use the following command
sudo htpasswd -m /etc/svnpasswd user2
Check out that everything is working fine.
Use your web browser to the SVNserver IP http://[ MY SVN SERVER IP ]/svn/
If you see a similar image to this means that everything is installed correctly. If you want to double check that everything is working well you need to install a SVN client, such us Tortoise, Eclipse, Netbeans, RabbitVCS, etc. If you can’t see this check out if you missed on of the previous steps, your machine connectivity, permissions, whether you had installed a previous Apache version, etc.
INSTALL TORTOISE FOR WINDOWS
Here: https://tortoisesvn.net/downloads.html
LINK PROJECT TO A FOLDER
Once you have successfully installed Tortoise for Windows.
– Create a folder and call it “repo”. Right-Click on your desk or on your Windows file explorer and you should have the SVN checkout option.
-In”URL of repository” use the previously used URL plus your repository name e.g.”myrepo”
http://10.0.135.109/svn/myrepo
– Click OK
– Create a file inside this folder. e.g. right-click create new text doc and name it “pueba.txt”
– Right-click on the newly created file SVN tortoise->add to repository
*With this we marked the file to be added to the repository
– Right-click and commit the file
NOTE: Intro the one previously created valid user and password when needed.
To double check that everything is committed to the repository go to your URL http://10.0.135.109/svn/myrepo
INSTALL A SVN CLIENT FOR LINUX
http://aruizca.com/how-to-integrate-rabbitvcs-with-nautilus-file-manager-in-ubuntu-14-04-trusty-tahr/
Click on “Checkout” and use your repository URL.
……………………………………………..
You can checkout a copy of the repository in into a working directory and do everything from there:
C> svn co svn://my_repo workingdir # sudo svn co http://10.8.55.53/svn/connect
C> cd workingdir # cd /svn/repos/connect/
C> svn mkdir trunk tags branches
C> svn commit -m”Creating basic directory structure”