Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

If you run

***xterm -ls***
to open a terminal with a login shell, you should find that whoami and who am i work fine. The same goes for a remote login using e.g. SSH.
3 years ago
XIM is a pretty obsolete input method protocol which both ibus and fcitx implement for legacy support reasons only. There is no real reason why you would want to use XIM nowadays over any of those two. The only reason why you would want to set GTK_IM_MODULE="xim" is to override GTK's hardcoded ComposeKey settings
3 years ago
I guess **localhost** refer to one IP address which is by default **127.0.0.1**, but, **localnet** refer to every network that you have an IP address from it on interface on your machine.

For example, if you have two interfaces and every one have its IP from different network so **localnets** can match all networks.

***eth0 ip 10.0.0.1 netmask 255.0.0.0
eth1 ip 192.168.0.1 netmask 255.255.255.0***

So **localnets** match (**10.0.0.0\8, 192.168.0.0\24**).
3 years ago
You can just use the -d switch and provide a date to be calculated
***date
Sun Sep 23 08:19:56 BST 2012
NEW_expration_DATE=$(date -d "+10 days")
echo $NEW_expration_DATE
Wed Oct 3 08:12:33 BST 2012 ***

This is quite a powerful tool as you can do things like
***date -d "Sun Sep 11 07:59:16 IST 2012+10 days"
Fri Sep 21 03:29:16 BST 2012***
3 years ago
***#!/usr/bin/gawk -f
BEGIN {
first=mktime(ARGV[1] " 01 01 00 00 00")
last=mktime(ARGV[2]+1 " 01 01 00 00 00")
if (ARGC == 4) { num=ARGV[3] } else { num=1 }
ARGC=1
range=last-first
srand(sprintf("%d%06d", systime(), PROCINFO["pid"]))
for (i=1; i <= num; i++) {
print strftime("%d/%m/%Y", range*rand()+first)
}
} ***
For example:
***./randomdate.gawk 1987 2017 6
26/04/1992
28/04/2010
21/04/2005
17/02/2010
06/10/2016
04/04/1998***
3 years ago
I like the two command line tools that use curl
*** | curl -F 'sprunge=<-' //sprunge.us

2>&1 | curl -F 'f:1=<-' ix.io***
You can make a simple function to save you having to remember the gory details, like so:
***sprung() { curl -F "sprunge=<-" //sprunge.us <"$1" ;}***
3 years ago
you might want to verify its integrity by comparing its SHA-256 checksum available in file:
*** //www.virtualbox.org/download/hashes/${LatestVirtualBoxVersion}/SHA256SUMS***

using
***sha256sum -c --ignore-missing SHA256SUMS***
Then, we install it as follows:
***sudo VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-${LatestVirtualBoxVersion}.vbox-extpack***

To verify if it has been successfully installed, we may list the installed extension packs:
***VBoxManage list extpacks***

To uninstall the extension pack:
***sudo VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"***
3 years ago
here's a way to run an interactive bash shell in trace mode (running the single command exit), piped to a grep that shows only the source and alias commands; the source command immediately above the alias of interest should be the file that contains the alias command.
***bash -ix -c exit 2>&1 | grep -E 'source | \. |alias '***
An instrumented run:
***$ tail -1 ~/.bashrc
[ -f /tmp/a.bashrc ] && source /tmp/a.bashrc
$ cat /tmp/a.bashrc
[ -f /tmp/b.bashrc ] && . /tmp/b.bashrc
$ cat /tmp/b.bashrc
alias answer='echo 42'

$ bash -ix -c exit 2>&1 | grep -E 'source | \. |alias '
+ alias 'ls=ls --color=auto'
+ source /tmp/a.bashrc
++ . /tmp/b.bashrc
+++ alias 'answer=echo 42'***
3 years ago
This one will give you your public IP, remove /ip part to see more info.
***$ curl ipinfo.io/ip***
3 years ago
You might want to use printf for its formatting options. echo is useful when it comes to printing the value of a variable or a (simple) line, but that's all there is to it. printf can basically do what the C version of it can do.

Example usage and capabilities:
Echo:
***echo "*** Backup shell script ***"
echo
echo "Runtime: $(date) @ $(hostname)"
echo***

printf:
***vech="bike"
printf "%s\n" "$vech"***
3 years ago
Since this is Linux I'm surprised no-one mentioned the numfmt command:

numfmt - Convert numbers from/to human-readable strings
***>>numfmt --to iec --format "%8.4f" 599511627776
558.3388G***
3 years ago
Edit
***/etc/mdm/mdm.conf***
and set
***AutomaticLoginEnable=false***
3 years ago