Sat, Aug 27, 2016 10:39 pm
Obtaining a list of fonts on a Mac OS X system
You can obtain a list of the fonts on a Mac OS X system using the
system_profiler
command
system_profiler SPFontsDataTye
. A large amount of
information will be displayed for each font, so you may want to capture the
output in a file, e.g.
fontslist.txt.
$ system_profiler SPFontsDataType > fontslist.txt
If you want the output in XML format,
you can include the -xml
option, e.g. system_profiler
-xml SPFontsDataType > fontslist.xml
.
[ More Info ]
[/os/os-x]
permanent link
Fri, Aug 26, 2016 9:39 pm
Unpausing paused OS X applications
I had a lot of windows and tabs open in the Safari web browser on my MacBook
Pro laptop running OS X 10.10.5 (Yosemite) as well as many other apps open.
I've found when I leave many browser tabs open for a prolonged period
that eventually they consume almost all of the system's memory. The
Activity Monitor application was
showing about 15 GB of the system's 16 GB of memory as in use. I closed a
couple of tabs, but then opened another one. Then I got the "spinning
beachball" and could do nothing further with Safari, so I clicked on the
Apple icon at the top, left-hand corner of the screen and chose
Force
Quit and forced Safari to quit. That reduced the "memory used" value
from about 15 GB down to about 5 GB, but I saw that many other applications
were listed as "paused" in the
Force Quit Applications window and I
could no longer use those applications - I just got the multi-colored, spinning
beach ball when I clicked on them or tried to access them by cycling through
open applications with
Command-Tab.
The Activity Monitor window showed those applications as
"Not Responding".
The Terminal application is not shown as "Not Responding"
in the Activity Monitor window, though it is shown as "paused" in
Force Quit Applications because I unpaused it prior to taking the
Activity Monitor screenshot. To unpause applications, I needed
to access a Terminal window to issue "kill -CONT" commands. You can use
kill commands to stop errant processes,
but you can also use kill -CONT pid
commands where
pid is the
process identifier (PID) of the process you wish to "unpause" to cause
a process to resume or "continue" its operation - see
Suspending and resuming a process on OS X.
[ More Info ]
[/os/os-x]
permanent link
Thu, Aug 25, 2016 10:32 pm
cat, rev, and tac commands
If you want to display the contents of a file on a Linux system, you can
use the
cat command -
the "cat" is shorthand for "concatenate.
$ cat sample.txt
Adhere to your purpose and you will soon feel as well as you ever did.
On the contrary, if you falter, and give up,
you will lose the power of keeping any resolution,
and will regret it all your life.
~ Abraham Lincoln in a June 28, 1862 letter to Quintin Campbell
$
Should you ever need to display the characters on a line in reverse order,
on a Linux system you can use the
rev command to do so - the
"rev" is shorthand for "reverse". E.g., suppose I want to display the same file
as in the example above. If I type rev sample.txt
, I will see
every line displayed in reverse with the last character in the line becoming
the first and the first the last.
$ rev sample.txt
.did reve uoy sa llew sa leef noos lliw uoy dna esoprup ruoy ot erehdA
,pu evig dna ,retlaf uoy fi ,yrartnoc eht nO
,noituloser yna gnipeek fo rewop eht esol lliw uoy
.efil ruoy lla ti terger lliw dna
llebpmaC nitniuQ ot rettel 2681 ,82 enuJ a ni nlocniL maharbA ~
$
If you wanted to display the last line as the first line and the first
line as the last rather than reversing the characters on each line, you can
use the tac command - "tac" is
"cat" in reverse. E.g., for the same
sample.txt file:
$ tac sample.txt
~ Abraham Lincoln in a June 28, 1862 letter to Quintin Campbell
and will regret it all your life.
you will lose the power of keeping any resolution,
On the contrary, if you falter, and give up,
Adhere to your purpose and you will soon feel as well as you ever did.
$
On a CentOS
Linux system, the cat
and tac
commands are part of the coreutils package while the rev
command is part of the util-linux package.
$ rpm -q --whatprovides /usr/bin/cat
coreutils-8.22-11.el7.x86_64
$ rpm -q --whatprovides /usr/bin/rev
util-linux-2.23.2-22.el7_1.x86_64
$ rpm -q --whatprovides /usr/bin/tac
coreutils-8.22-11.el7.x86_64
$
The util-linux package can be obtained using whatever
package
management utility you normally use for your distribution of Linux,
e.g., yum for CentOS, or you can obtain the utility via
FTP
from the Linux Kernel Archive at ftp.kernel.org. You can login using
"anonymous" as the userid and anything for the password, then type
cd pub/linux/utils/util-linux
to see the available versions.
[/os/unix/commands]
permanent link
Wed, Aug 24, 2016 11:03 pm
Voice recognition software surpasses humans typing
I've had my current Android smartphone for several years, but have never
tried its voice recognition features. I did try the feature on my prior
phone, but after a few frustrating attempts to just have it call home when
I said my wife's name, I deemed the feature useless to me; it was too
aggravating to have the phone say something like "Did you say..." followed by
something entirely unrelated. Though I might eventually get it to dial our
home number, the process was more time consuming than for me to just type
in the phone number. But after hearing an NPR report today while I was driving
home on a recent study conducted jointly between researchers at
Stanford University, the
University of Washington
and the Chinese search engine company
Baidu that
pitted humans typing on Apple
iOS
keyboards against Baidu's speech recognition software, I'll see how well
the speech dictation software works on my current phone. The results of
the study can be found on a Stanford University site at
Speech Is 3x
Faster than Typing for English and Mandarin Text Entry on Mobile Devices.
For the speech transcription method, the researchers used Baidu's
Deep Speech 2 deep learning speech recognition system. The software
took the spoken input and converted it to text. Recognition errors could
then be corrected by the study participants by either speech or the
smartphone's keyboard. That method was found to be three times faster than
the participants relying solely on their typing skills on the keyboards
for English and 2.8 times as fast for Mandarin Chinese. And, strikingly,
the English error rate was 20.4% lower, and the Mandarin error rate 63.4%
lower, than the keyboard method. I don't know Mandarin, but a 20.4% lower error
rate for English is significant.
I took a typing class in high school - when I was in high school typewriters
were still common - after the typing teacher stated that it would be useful
for typing papers for those of us who hoped to go on to college. I bought
a cheap typewriter in college, but didn't use it much, instead I had most
of the papers I needed to be typewritten typed by a local high school teacher
who, as a side business typed papers for the nearby university students at
a nominal cost. She also proofread the papers, correcting spelling and grammar
errors, which I felt was worth the cost of paying to have papers typed that
would be an important part of my grade. But, though I didn't use the typing
skills I learned in the high school typing class a lot for typing papers,
I found those skills invaluable for the many later computer courses I took.
So, I'm a fairly fast typist on a full size keyboard, but I'm very slow on
the tiny keyboard on my phone and am akin to the sloth, Flash, in the movie
Zootopia when compared
to some of my nieces - one of my nephews bought a phone for his younger sister,
but had to quickly change the text plan when she had 3,000 text messages one
month. For her, typing her text messages might be faster than using the voice
recognition feature on her phone, but, even though the voice recognition
software on my phone is doubtless far less powerful than that of Baidu's
Deep Speech 2, I'll try that feature of the phone, since I would also expect
there has been improvement in the intervening years since I first tried the
feature on a prior phone. As Baidu chief scientist Andrew Ng noted
"Humanity was never designed to communicate by using our fingers to poke
at a tiny little keyboard on a mobile phone. Speech has always been a
much more natural way for humans to communicate with each other."
Ng also stated he looks forward to the day when his future grandchild
comes home and asks, "Is it really true that when you were young, if you
came home and you said something to your microwave oven — did it really
just sit there and ignore you? That's just so rude of the microwave." As
we move futher into the
Internet of Things
(IoT), I expect that people talking to their microwaves and other household
appliances will become common.
A text version of the NPR article, which was broadcast on
All Things Considered, is available at
Voice Recognition Software Finally Beats Humans At Typing, Study Finds.
[/news]
permanent link
Mon, Aug 22, 2016 11:45 pm
Substituting characters for a matched regular expression in vi
The
vi editor
is a screen-oriented
text editor that supports
regular expressions for pattern matching and character substitution.
Vim which stands for "Vi IMproved" is a clone of vi and recognizes similar
commands.
If you want to replace or insert characters at the beginning of a line,
the line beginning is represented by the
caret character, i.e.,
^
(Shift-6 on a standard computer keyboard), and line
endings are represented by the
dollar sign character,
i.e., $
.
E.g., the following quote has three occurences of the word "us". If I wanted
to replace only the "us" at the end of the line with "ourselves", I could hit
the colon key while not in vi's insert mode, which would give me a colon prompt
and then enter s /us$/ourselves/
which would replace the occurence
of "us" at the end of the lne with "ourselves".
What lies behind us and what lies before us are tiny compared to what lies
within us
~ Ralph Waldo Emerson
[ More Info ]
[/software/editors/vi]
permanent link
Sat, Aug 20, 2016 9:57 pm
Changing the line spacing in Publisher 2013
To change the spacing between lines in
Microsoft Publisher 2013, take the following steps:
-
Click on Home at the top, left side of the Publisher window.
-
Highlight the the text for which you wish to change the line spacing by
clicking on the start of it and dragging
the mouse pointer to the end of it.
-
Click on the diagonally pointing arrow at the lower, right-hand corner
of the Paragraph block.
-
In the Paragraph options window, change the "between lines" value for
line spacing.
-
Click on OK.
[ More Info ]
[/software/office/2013/Publisher]
permanent link
Fri, Aug 19, 2016 4:19 pm
Viewing Berkeley DB files
If you have .db files on a Linux system, they may be
Berkeley DB (BDB)
database files. Berkeley DB originated at the
University of California, Berkeley as part of
BSD, Berkeley's version of the
Unix operating
system. The initial release was in 1994. Berkely DB was futher developed by
SleepyCat Software
from 1996 to 2006. In February 2006,
Oracle Corporation
acquired SleepyCat and continued development of the software.
You can ascertain if a .db file is a BDB file using
the file command.
E.g., the
Sendmail email software uses .db files stored in /etc/mail
to control various aspects of the software's functionality. For instance,
you can specify the domains for which Sendmail will accept email in
the /etc/mail/local-host-names
file or create "virtual users"
using the /etc/mail/virtusertable
file. But to alter
Sendmail's behavior using these files, you need to generate .db files from
the text files using the
makemap command. E.g., makemap hash
/etc/mail/virtusertable < /etc/mail/virtusertable
. If you check
the type of file for the .db file that will be created by the
makemap
utility with the file
command, you will
see the following information, if you check from the root account:
# file /etc/mail/virtusertable.db
/etc/mail/virtusertable.db: Berkeley DB (Hash, version 9, native byte-order)
#
[ More Info ]
[/software/database/berkeley_db]
permanent link
Thu, Aug 18, 2016 10:46 pm
Bitdefender milter causing Sendmail restart failure
I needed to change the
smart host setting for a Sendmail email server, so I edited
/etc/mail/sendmail.mc
and rebuilt
/etc/mail/sendmail.cf
with the
m4 command.
I then attempted to restart
Sendmail, but it did not restart.
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# service sendmail restart
Redirecting to /bin/systemctl restart sendmail.service
Job for sendmail.service failed because the control process exited with error code. See "systemctl status sendmail.service" and "journalctl -xe" for details.
When I issued a systemctl status sendmail.service
command
for further information, I saw the following:
# systemctl status sendmail.service
● sendmail.service - Sendmail Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2016-08-18 15:40:49 EDT; 11s ago
Process: 25578 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=78)
Process: 25573 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
Process: 25570 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
Main PID: 3394 (code=exited, status=0/SUCCESS)
Aug 18 15:40:49 moonpoint.com systemd[1]: Starting Sendmail Mail Transport A....
Aug 18 15:40:49 moonpoint.com sendmail[25578]: 554 5.0.0 /etc/mail/sendmail....d
Aug 18 15:40:49 moonpoint.com sendmail[25578]: NOQUEUE: SYSERR(root): /etc/m...d
Aug 18 15:40:49 moonpoint.com sendmail[25578]: NOQUEUE: SYSERR(root): InputF...y
Aug 18 15:40:49 moonpoint.com sendmail[25578]: 451 4.0.0 InputFilter BitDefe...y
Aug 18 15:40:49 moonpoint.com systemd[1]: sendmail.service: control process ...8
Aug 18 15:40:49 moonpoint.com systemd[1]: Failed to start Sendmail Mail Tran....
Aug 18 15:40:49 moonpoint.com systemd[1]: Unit sendmail.service entered fail....
Aug 18 15:40:49 moonpoint.com systemd[1]: sendmail.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
When I undid the changes I had made to sendmail.mc
, the issue
remained. When I used the
journalctl command to check on the problem, I saw the following:
# journalctl -xe
--
-- Unit sendmail.service has failed.
--
-- The result is failed.
Aug 18 15:43:25 moonpoint.com systemd[1]: Dependency failed for Sendmail Mail Tr
-- Subject: Unit sm-client.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit sm-client.service has failed.
--
-- The result is dependency.
Aug 18 15:43:25 moonpoint.com systemd[1]: Job sm-client.service/start failed wit
Aug 18 15:43:25 moonpoint.com systemd[1]: Unit sendmail.service entered failed s
Aug 18 15:43:25 moonpoint.com systemd[1]: sendmail.service failed.
Aug 18 15:43:25 moonpoint.com polkitd[771]: Unregistered Authentication Agent fo
Aug 18 15:43:53 moonpoint.com sshd[25845]: Address 168.176.56.13 maps to wimax13
Aug 18 15:43:53 moonpoint.com sshd[25845]: Invalid user log from 168.176.56.13
Aug 18 15:43:53 moonpoint.com sshd[25845]: input_userauth_request: invalid user
Aug 18 15:43:53 moonpoint.com sshd[25845]: pam_unix(sshd:auth): check pass; user
Aug 18 15:43:53 moonpoint.com sshd[25845]: pam_unix(sshd:auth): authentication f
Aug 18 15:43:55 moonpoint.com sshd[25845]: Failed password for invalid user log
Aug 18 15:43:56 moonpoint.com sshd[25845]: Connection closed by 168.176.56.13 [p
lines 1490-1512/1512 (END)
[ More
Info ]
[/network/email/sendmail]
permanent link
Wed, Aug 17, 2016 11:55 pm
Starting the Windows 10 System Restore program from a command prompt
The Windows
System Restore utility can be started from a command
line interface (CLI) by typing the command
rstrui
at a command
prompt.
Click on Next to see available restore points.
[/os/windows/win10]
permanent link
Tue, Aug 16, 2016 10:09 pm
Changing the AutoSave time in Microsoft Publisher 2013
Microsoft Office applications, such as the
desktop publishing application
Microsoft Publisher, have a built-in
autosave
feature that will periodically save your work in progress at a set interval,
so that you won't accidentally lose all the work you you've done while
working on a document in the application in the event the application or the
entire system crashes. The default setting for automatic saves in Publisher
2013 is ten minutes. To adjust that setting, take the following steps in
Publisher:
- Click on File from the program's menu.
- Select Options.
- Click on Save.
- The default setting is to save any document changes
every 10 minutes. Change the value to whatever you like and click on OK.
[/software/office]
permanent link
Mon, Aug 15, 2016 10:17 pm
Configuring Firewalld and Postfix on CentOS for SMTP connections
I needed to configure a NetScreen firewall to allow access to the
Simple Mail Transfer Protocol (SMTP) port,
port 25, on a
CentOS 7 email server
behind the firewall. After
configuring the NetScreen firewall to allow SMTP connectivity, I found I
still was not able to connect to the mail sever behind it from an external
system. When I tested using
Telnet, i.e.,
telnet 192.168.0.7 25
, I saw a
"no route to host" message.
$ telnet 192.168.1.7 25
Trying 192.168.1.7...
telnet: connect to address 192.168.1.7: No route to host
$
So I used the debug
command on the NetScreen firewall to view traffic to the SMTP port, which
showed me it was passing the traffic to the email server behind it. So I then
checked the host-based software on the CentOS server. Since it was running
CentOS 7, the default firewall management software on it is
FirewallD.
I first checked to see what services the firewall was allowing through and saw
that SMTP wasn't included, so I added that to the allowed services and made
it a permanent rather than temporary change. For permanent changes, the firewall
software must be reloaded, so I then issued a reload command. Since I ran the
commands from a normal user account, I was prompted to provide the root
account password to add the service and reload the firewall software.
$ firewall-cmd --list-services
dhcpv6-client ssh
$ firewall-cmd --add-service=smtp --permanent
success
$ firewall-cmd --reload
success
$ firewall-cmd --list-services
dhcpv6-client smtp ssh
$
[ More Info ]
[/network/email/postfix]
permanent link
Sun, Aug 14, 2016 10:41 pm
COUNTIFS with an "or" condition
I have an Excel spreadsheet where I track firewall rule requests. Column B
in the spreadsheet tracks the status of requests that have been submitted.
A request can have a status of "modified", "pending", "approved", "denied",
"completed", or "implement removal". Column G contains the dates when a
request was either approved or denied. I could calculate how many requests
I approved or denied since a particular date by putting that date in cell F947.
I use a
COUNTIFS function,
which allows you to count the number of instances where an entry in a
spredsheet meets multiple criteria. E.g., the value in column B for a row
is greater than 10 and, also, the value in column C is "Jane". I use the
formula
=COUNTIFS(G2:G932,">="&F947, B2:B932,"Denied")
to calculate all the entries that have been denied since a particular date.
E.g., if cell F947 contains the date 8/10/2016, I can count all the rows
starting with G2, since the first row is a header row, up through the last
entry where the date in column 2 is greater than or equal to August 10, 2016
and the status in column B is "Denied". I can also calculate the number of
requests I've dealt with since that date with
=COUNTIF(G2:G932,">="&F947)
, i.e., I have Excel count
any entries where the date is greater than or equal to the date
specified in cell F947. I can also count the number of requests
with a particular status that indicates the request was approved,
but then might have been implemented, which would send it to the
"Completed" state or which had been approved, but, because the
approval was for the removal of rules from firewalls, went to the
"Implement Removal" state with the following:
=COUNTIFS(G2:G931,">="&F947,B2:B931,"Approved")
=COUNTIFS(G2:G931,">="&F947,B2:B931,"Completed")
COUNTIFS(G2:G931,">="&F947,B2:B931,"Implement Removal")
All of the above indicate that the request was approved, though the
status for the request might not be listed as "Approved" in the system
used to manage the requests, but could, instead be shown as
"Completed" or "Implement Removal".
But I also wanted to have a cell where Excel would provide a total for
the number of requests that were in any of the above states where the
date for the request in the G column was on or after the specified date.
To do so, I had to
"sum"
multiple "countifs" statements, since I couldn't find a way to
easily put an "and" or "or" logical condition within a countifs
statement. I was able to get the total with the below forumula:
=SUM(COUNTIFS(G2:G931,">="&F947,B2:B931,"Approved"), COUNTIFS(G2:G931,">="&F947,B2:B931,"Completed"), COUNTIFS(G2:G931,">="&F947,B2:B931,"Implement Removal"))
[/software/office]
permanent link
Sat, Aug 13, 2016 9:38 pm
Determining which repository a package comes from
If you want to determine which
software
repository a
package can be found in from a
CentOS Linux
system, you can use the
repoquery command
or
yum info commands.
A package doesn't have to be installed on the system for you to determine
which repository it can be found in.
[ More Info ]
[/os/unix/linux/centos]
permanent link
Fri, Aug 12, 2016 10:41 pm
Installing Amarok on a CentOS system
If you would like to have a
free and open
source,
cross-platform, music player for use on a Linux system,
Amarok
, which was created by Mark Kretschmann, provides the capability to play
various audio media files, such as MP3, FLAC, Ogg, AAC, etc. It also allows
you to stream online music from services such as
Jamendo,
Shoutcast, etc.
To install Amarok on a CentOS Linux system using the
yum package management utility, you will first need to
configure the system to
check the EPEL repository for packages. Once you have done that, you can
issue the command yum install amarok
from the root account to
install the software.
[ More Info ]
[/software/audio_video/Amarok]
permanent link
Wed, Aug 10, 2016 10:38 pm
DHCP Reserved Address from NetScreen Firewall
A
Juniper Networks NetScreen firewall/router can be configured to function
as a
DHCP
server; for the method to do so from a command line interface
(CLI), which you can obtain by a
Secure Shell (SSH)
connection to the device,
see
Using a Juniper Networks NetScreen Firewall as a DHCP Server.
The system can assign addresses dynamically from a pool of addresses you select
or you can have it assign a reserved, i.e., fixed, address based on the
media access control (MAC) address of the system requesting a DHCP-assigned
IP address.
You can determine what addresses have already been assigned to systems
via DHCP using a command in the form get interface <interface>
dhcp server ip allocate
where interface is a particular interface,
e.g., trust, untrust, etc.
ns5xp-> get interface trust dhcp server ip allocate
IP State MAC Lease Time
192.168.0.34 COMMIT *000d560e185e 3236 minutes
192.168.0.35 COMMIT *4c72b99cb82a 3925 minutes
ns5xp->
If I wished to assign the IP address 192.168.0.7 to the system above with
MAC address 4c72b99cb82a, I could use the command below:
set interface trust dhcp server ip 192.168.0.7 mac 4c72b99cb82a
[ More Info ]
[/security/firewalls/netscreen]
permanent link
Tue, Aug 09, 2016 10:26 pm
SSH break-in attempt from 221.229.172.35
When I checked the
fail2ban log on one of my servers today, I found that
fail2ban had banned IP address
221.229.172.35
for failed attempts to log into the system
via
Secure
Shell (SSH).
# tail -n 10 /var/log/fail2ban.log
2016-08-09 10:12:56,296 fail2ban.filter [1590]: INFO [sshd] Found 221.229.172.35
2016-08-09 10:12:57,914 fail2ban.filter [1590]: INFO [sshd] Found 221.229.172.35
2016-08-09 10:12:58,663 fail2ban.filter [1590]: INFO [sshd] Found 221.229.172.35
2016-08-09 10:12:59,143 fail2ban.filter [1590]: INFO [sshd] Found 221.229.172.35
2016-08-09 10:12:59,870 fail2ban.actions [1590]: NOTICE [sshd] Ban 221.229.172.35
2016-08-09 10:13:00,591 fail2ban.filter [1590]: INFO [sshd] Found 221.229.172.35
2016-08-09 10:13:01,298 fail2ban.filter [1590]: INFO [sshd] Found 221.229.172.35
2016-08-09 10:13:01,522 fail2ban.filter [1590]: INFO [sshd] Found 221.229.172.35
2016-08-09 10:13:03,538 fail2ban.filter [1590]: INFO [sshd] Found 221.229.172.35
2016-08-09 10:13:04,075 fail2ban.filter [1590]: INFO [sshd] Found 221.229.172.35
#
When I checked the country where that IP address is assigned using the
geoiplookup tool, I found it is assigned to an entity in China. The tool
is in GeoIP, a
geolocation
package, which can be installed on
Red Hat
derived distributions of Linux, such as
CentOS with
yum install geoip
. The free version of the software which I use is
provided by MaxMind
$ geoiplookup 221.229.172.35
GeoIP Country Edition: CN, China
$
[ More Info ]
[/security/attacks/ssh]
permanent link
Mon, Aug 08, 2016 10:09 pm
Using dhclient to locate DHCP Servers on a LAN
On a Linux system, you can use the
dhclient
command to identify any
Dynamic Host
Configuration Protocol (DHCP) servers that are available on the
local area network (LAN).
First, you need to determine a relevant network interface on the system
over which an IP address might be acquired via DHCP. You can do so using
the
ip command. If the
-f inet
option is given to the command, it will show only IPv4
addresses.
# ip -f inet address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet 192.168.0.35/24 brd 192.168.0.255 scope global dynamic enp4s0
valid_lft 156092sec preferred_lft 156092sec
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
Alteratively, you can use the
ifconfig command with the -a
option to show all network
interfaces and any assigned IP addresses for them. I.e.,
ifconfig -a
.
In the example above from a CentOS 7 system, I can see that an IP address is
assigned to the enp4s0
network interface and that is the interface
I will use for the DHCP query to locate any DHCP servers on the network, which
may be legitimate or rogue DNS servers.
To have the dhclient command search for DHCP servers, I'll use the
-d
and -nw
options.
[ More Info ]
[/network/dhcp]
permanent link
Sun, Aug 07, 2016 8:35 pm
Postfix commands
You can usually determine what
mail
transfer agent software is running on an email server by using
Telnet
to connect to the mail server on the
Simple Mail Transfer Protocol (SMTP) port, port 25. E.g.,
in the example below
Postfix is handling email on the system.
# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 jinn.localdomain ESMTP Postfix
quit
221 2.0.0 Bye
Connection closed by foreign host.
#
You can enter SMTP commands that other email servers would issue to
send an email to a local user on the system as shown below:
# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 jinn.localdomain ESMTP Postfix
ehlo Me
250-jinn.localdomain
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: tester@example.com
250 2.1.0 Ok
rcpt to: joe
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
From: tester22@example.com
To: joe@example.com
Subject: Just a test
This is only a test.
.
250 2.0.0 Ok: queued as B27928276DA1
quit
221 2.0.0 Bye
Connection closed by foreign host.
$
[ More Info ]
[/network/email]
permanent link
Sat, Aug 06, 2016 10:37 pm
Dovecot not accepting passwords
A user reported that email was not working. So I logged into an account
on the
CentOS 7 email server
and connected to port 25, the
Simple Mail
Transport Protocol (SMTP) port, via
Telnet to
ensure that the server was responding to SMTP connections.
$ telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 moonpoint.com ESMTP Sendmail 8.14.7/8.14.7; Sat, 6 Aug 2016 09:26:06 -0400
quit
221 2.0.0 moonpoint.com closing connection
Connection closed by foreign host.
$
Since the
Sendmail SMTP service seemed to be functioning properly, I next checked
the
Dovecot POP3/POP3S software on the system. I entered the commands
an email client would submit to authenticate with the server on the POP3 port,
port 110, i.e., pass
followed by the user's login id then
pass
and the password for the user's account. I received an
immediate response to the user
command, but when I entered
the pass
command followed by the password and hit Enter
I didn't see any response even after waiting much longer than I would expect
to have to wait for a response. So I hit Ctrl-], i.e., the Ctrl
and ] keys to return to the Telnet prompt and then exited from
the telnet program.
[ More Info ]
[/network/email/dovecot]
permanent link
Fri, Aug 05, 2016 10:45 pm
Konqueror Saved Sessions Location
The
Konqueror
web browser, which is available for Linux and Microsoft Windows systems,
provides a mechanism to save and restore sessions. If Konqueror becomes unresponsive and
you have to kill it, you should be given a choice to restore the previous
session when you reopen the browser.
You can manually save a session, by clicking on File on the menu bar,
then selecting Sessions, then Save As.... You will then
be prompted to provide a name for the session.
You can reopen a saved session by selecting File then Sessions
from the menu bar and then selecting from one of the saved sessions
you will see listed. If you have previously saved one or more sessions,
you will see them listed under the Save As... and Manage...
options.
[ More Info ]
[/network/web/browser/konqueror]
permanent link
Thu, Aug 04, 2016 10:53 pm
Using the zipinfo command
If you wish to view a list of the files contained in a
zip
file, i.e., one with a .zip extension, on Linux and Mac OS X systems you
can use the
zipinfo
command. If you enter the command
zipinfo
followed by the
name of the zip file, you will see a Unix-style file listing for each
compressed file contained within the zip file.
$ ls -l vnc-osx.zip
-rw-r--r--. 1 joe joe 57641 Jun 28 2013 vnc-osx.zip
$ zipinfo vnc-osx.zip
Archive: vnc-osx.zip
Zip file size: 57641 bytes, number of entries: 4
drwxr-xr-x 3.0 unx 0 bx stor 13-Jun-28 12:43 vnc/
-rw-r--r-- 3.0 unx 21375 bx defN 13-Jun-27 20:31 vnc/Connect_to_Server.png
-rw-r--r-- 3.0 unx 36303 bx defN 13-Jun-27 20:33 vnc/Enter_Name_Password.png
-rw-r--r-- 3.0 unx 2834 tx defN 13-Jun-28 12:43 vnc/vnc-remote-access.html
4 files, 60512 bytes uncompressed, 56943 bytes compressed: 5.9%
$
In the example above you can see that there are three files stored in the
zip file; the output indicates 4 files because the directory, vnc, is counted
as a file on a Unix system. The total bytes for the four files before they
were compressed into a zip file is 60,512 bytes. They were compressed
down to 56,943 bytes, which is a 5.9% compression ratio, since (60512 -
56943) / 60512.0 * 100 = 5.9.
If you just wish to see the file and directory names contained in the zip
file, you can use the -1
argument (that's the number one).
$ zipinfo -1 vnc-osx.zip
vnc/
vnc/Connect_to_Server.png
vnc/Enter_Name_Password.png
vnc/vnc-remote-access.html
$
[ More Info ]
[/os/unix/commands]
permanent link
Wed, Aug 03, 2016 10:22 pm
GIMP Color Picker
I wanted to determine the hexadecimal or RGB values for the text in a Terminal
window on a CentOS 7 Linux system. I didn't have gpick or another color picker
utility available, but I did have the
GNU Image
Manipulation Program (GIMP) already installed on the system (you can
install it on a CentOS system with
yum install gimp
), so
I was able to
take a
screenshot of the window with GIMP and then use GIMP's
color picker tool to determine the color of the
text. To access the color picker tool, select
Tools and then Color
Picker from the GIMP menu.
[ More Info ]
[/software/graphics/gimp]
permanent link
Mon, Aug 01, 2016 11:08 pm
Determining the version of Microsoft Windows from the command line
You can determine the version of Microsoft Windows on a system from a
command line interface (CLI), e.g., a command prompt, using the
systeminfo command.
Since that command will provide a lot of other information
on the system, you can filter the output to see only the
operating system (OS) version by piping its output into the
findstr command using
the "|"
pipe character. The command below will show only the
operating system version:
C:\>systeminfo | findstr /R "^OS.Version"
OS Version: 10.0.10586 N/A Build 10586
C:\>
The /R
option indicates that the findstr command should perform
its search based on a regular expression. The "^" character is a character
that when included in a regular expression means that what follows should be
at the beginning of the line. Without it, you could see something like the
following, instead, since "BIOS Version also matches:
C:\>systeminfo | findstr /R "OS.Version"
systeminfo | findstr /R "OS.Version"
OS Version: 10.0.10586 N/A Build 10586
BIOS Version: Dell Inc. A04, 11/21/2011
C:\>
The period between "OS" and "Version" indicates in a regular expression that
any one character in that space will match; in this case there is a space
character between the two words, which will match the period in a regular
expression. If you want to have a period treated as a period rather than
serving its function as a regular expression character, you can "escape"
its meaning by using the backslash, i.e. "\",
escape character.
[ More Info ]
[/network/email/sendmail]
permanent link
Privacy Policy
Contact