If you want to change the location of the Desktop, Documents, Download, ... directories:
vi ~/.config/user-dirs.dirs
vi ~/.config/user-dirs.dirs
sudo dpkg-reconfigure gdm
sudo dpkg-reconfigure kdm
sudo dpkg-reconfigure lightdm
sudo vim /etc/lightdm/lightdm.confand change
greeter-session=unity-greeterto
greeter-session=lightdm-gtk-greeteror something. There are multiply *-greeter packages you can install and use
username ALL=(ALL) NOPASSWD: COMMANDPlease note that this has to be after all group definitions.
sudo -lFor this case this gives:
(ALL) ALLThis means that all command require password except for the COMMAND. If we would put the username definitin before group definitions sudo -l would give:
(ALL) NOPASSWD: COMMAND
(ALL) NOPASSWD: COMMANDThis would still require password for all commands.
(ALL) ALL
hg grep --all PIECE_OF_CODE | awk 'BEGIN {FS=":"} {print $1" "$2}' | uniq
repo/src/java/com/kovica/File1.java 30
repo/src/java/com/kovica/File1.java 10
sudo apt-get install unclutter
#!/bin/bashdeviceName="AlpsPS/2 ALPS DualPoint TouchPad"
isEnabled=`xinput --list-props "$deviceName" | grep -e "Device Enabled.*1$"`
if [ -n "$isEnabled" ]; then
echo Disabling touchpad $deviceName
xinput --set-prop "$deviceName" "Device Enabled" 0
unclutter &
else
echo Enabling touchpad $deviceName
killall unclutter
xinput --set-prop "$deviceName" "Device Enabled" 1
fi
Name of my touchpad device is AlpsPS/2 ALPS DualPoint TouchPad. You can find the list of all input devices issuing
xinput listthen you just have to guess what device it is :)
synclient TouchpadOff=1If this command disables your touchpad then toogleTouchpad.sh might look like this:
#!/bin/bash
isEnabled=`synclient | grep -e ".*TouchpadOff.*0$"`
if [ -n "$isEnabled" ]; then
echo Disabling device
synclient TouchpadOff=1
unclutter &
else
echo Enabling device
killall unclutter
synclient TouchpadOff=0
fi
pm list-users gives something like:
Users:
UserInfo{0:Primary:3}
UserInfo{1:foo:3}
xterm -bg black -fg grey -fn -*-console-*-*-*-*-*-*-*-*-*-*-*-* -geometry 166x45
File lockFile = new File("APP_NAME.lock");
FileChannel fileChannel = new RandomAccessFile(lockFile, "rw").getChannel();
FileLock fileLock = fileChannel.lock();
#!C:/Python26/python.exe -u
#
# An example FastCGI script for use with flup, edit as necessary
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "d:/HG/hgweb.config"
# Uncomment and adjust if Mercurial is not installed system-wide:
import sys
sys.path.insert(0, "C:/Apps/HG/dev")
# Uncomment to send python tracebacks to the browser if an error occurs:
import cgitb; cgitb.enable()
import os
os.environ["HGENCODING"] = "UTF-8"
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb
from flup.server.fcgi import WSGIServer
application = hgweb(config)
WSGIServer(application).run()
[paths]
# One repository
#FOO = d:/HG/repos/FOO
# All repositories in d:/HG/repos
/ = d:/HG/repos/**
[web]
style = gitweb
[web]
description = Repository description
style = gitweb
allow_push = *
push_ssl = false
verbose = false
allowbz2 = yes
allowgz = yes
allowzip = yes
[ui]
username = Owner of repo <repo.owner@example.com>
debug = false
LoadModule cgi_module modules/mod_cgi.so
LoadModule env_module modules/mod_env.so
SetEnv FCGI_FORCE_CGI Y
ScriptAliasMatch ^/hg(.*) d:/HG/hgweb.fcgi$1
<Directory d:/HG>
Options ExecCGI FollowSymLinks
AllowOverride None
AddHandler cgi-script .cgi
Allow from all
AllowOverride All
</Directory>
<Location /hg>
AuthType Basic
AuthName "Mercurial repositories"
AuthUserFile D:/HG/hgusers
Require valid-user
</Location>
htpasswd -c D:/HG/hgusers frodo # creates file D:/HG/hgusers and adds user frodo
htpasswd D:/HG/hgusers sam # only add usersam to exising D:/HG/hgusers file
./configure -plugin-sql-db2 -v -I /opt/ibm/db2/V9.7/include -L /opt/ibm/db2/V9.7/lib64/
make
make install (if you want to install it)
[DB_NAME]
Description = Connection to DB_NAME
Driver=$HOME/sqllib/lib/libdb2.so
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName("DB_NAME");
db.setUserName("DB_USER");
db.setPassword("DB_PASS");
db.open();
QSqlError error = db.lastError();
qDebug() << "db error = " << error;
QSqlQuery query = db.exec("SELECT 1 FROM SYSIBM.SYSDUMMY1");
while (query.next() == true) {
qDebug() << query.value(0).toString();
}
public class SAPAuthenticator extends Authenticator
{
private String username;
private char[] password;
public SAPAuthenticator(String username, char[] password)
{
this.username = username;
this.password = password;
}
@Override
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication(username, password);
}
}
Authenticator.setDefault(new SAPAuthenticator("username", "password".toCharArray()));
((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "username");
((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password");
usermod --password `openssl passwd PASSWORD_TO_USE` USERNAME
password [success=1 default=ignore] pam_unix.so obscure sha512
password [success=1 default=ignore] pam_unix.so obscure md5
openssl pkcs12 -in myFile.p12 -out myPublicKey.pem -clcerts -nokeys
LANG=en_us date "+%b %d" | xargs -i grep -m1 -i {} /var/log/syslog.0 | awk '{ print "Today I got to work at " $3 }'
request.setCharacterEncoding("UTF-8");ip route add 224.0.0.0/4 via YOUR_CURRENT_IP
D:\Apps\glassfish\lib>sc.exe create domain1 binPath="d:\Apps\glassfish\lib\appservService.exe
\"d:\Apps\glassfish\bin\asadmin.batstart-domaindomain1\"
\"d:\Apps\glassfish\bin\asadmin.bat stop-domain domain1\"" start= auto DisplayName= "SunJavaSystemAppServer DOMAIN1"
D:\Apps\glassfish\lib>sc.exe create domain1 binPath= "d:\Apps\glassfish\lib\appservService.exe
\"d:\Apps\glassfish\bin\asadmin.batstart-domaindomain1\"
\"d:\Apps\glassfish\bin\asadmin.bat stop-domain domain1\"" start= auto DisplayName= "SunJavaSystemAppServer DOMAIN1"