←May→
Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
|
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
|
|
|
|
Sun, May 27, 2018 9:13 pm
Centering divs with flex-container
With
HTML 4, centering the contents within a
div is simple. You
just use <div align="center">
. E.g., if I wanted to
center the image and text below on a webpage, I could use the following
code:
<div align="center">
<img src="186px-Antinous_Mandragone_profil.jpg" alt="Antinous Mangragone
profile"><br>
<a href="https://commons.wikimedia.org/wiki/File:Antinous_Mandragone_profil.jpg">
Antinous Mandragone</a>
</div>
The image would then be displayed in browsers as seen below:
[ More Info ]
[/network/web/html/css]
permanent link
Thu, May 24, 2018 11:10 pm
Using sox to record audio on OS X
I wanted to record a talk this week so I took my
MacBook Pro
laptop with me to the auditorium where the talk was being held. I
normally
use the QuickTime
Player to record audio in such cases. But this time when I attempted
to use the QuickTime Player, it wouldn't actually start recording.
The presenters had started talking when I attempted to begin recording
their presentation, so I opted to install
Sound eXchange
(SoX), which provides a
command-line interface (CLI) for recording and
editing audio on a variety of
operating systems, including
Microsoft Windows,
Linux, and
OS X. Since I had previously
installed Homebrew on OS X on the system, I
opened a
Terminal window and used it to install SoX.
[ More Info ]
[/os/os-x/audio]
permanent link
Wed, May 23, 2018 10:53 pm
Dovecot restart
A user reported that she was unable to check her email today; she had also
reported the problem yesterday. When I checked
Sendmail,
which would handle her outgoing email, by using
Telnet to
connect to the well-known port for
Simple Mail Transfer Protocol (SMTP) on the server with
telnet mail.example.com 25
, I saw the Sendmail banner as expected,
so I presumed her problem was likely with
Dovecot, the software on the system that would allow her to receive her
incoming email. I tried connecting to port 110, the well-known port
for Post Office Protocol version 3 (POP3) connections using
Telnet. When I saw the "Connected to" and "Escape character is" messages, I
entered the POP3 user
command followed by the user's name,
but I would shortly thereafter see a "Connection closed" message every
time I tried the connection with Telnet. I never saw the "Dovecot ready" prompt
appear.
# telnet 127.0.0.1 110
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
user nell
Connection closed by foreign host.
You have new mail in /var/spool/mail/root
#
[ More Info ]
[/network/email/dovecot]
permanent link
Fri, May 18, 2018 10:56 pm
Installing new packages for WinPython
To install a new package/module under
WinPython, double-click on WinPython Command Prompt
in
the directory where you installed WinPython to open a command prompt window.
At the command prompt window type pip install pkgname
where pkgname is the name of the package you wish to install. If the
package is already present, you will see the message "requirement already
satisfied."
[ More Info ]
[/languages/python]
permanent link
Thu, May 17, 2018 11:15 pm
Identifying Apple systems on the network
If you need to determine whether a system on the network is an
Apple
system, there are a number of means you can use to help identify whether
the system is, or is at least likely to be, manufactured by Apple. E.g.,
if the system is on the same
local area network (LAN) as a system from which you can
ping it, you can check the
media access control (MAC) address associated with the
IP address
you just pinged using the
Address Resolution Protocol (ARP), since the first 6
hexadecimal
digits of the MAC address can be used to identify the manufacturer of the
network interface controller (NIC) in the device pinged.
This technique won't work if there is an intervening
router between the device from which the ping is sent and the
receiving device, though, since the arp address you will see when there are
intervening
network hops is the one of the first hop device. You can see the number
of hops between the source and destination hosts using the
traceroute command (tracert is the equivalent command on
Microsoft Windows systems). E.g., in the example
below, I issued a ping command from a
Terminal window on my
MacBook
Pro laptop running OS X El Capitan (10.11.6). When I then peformed a
reverse DNS lookup on the IP address using
nslookup,
the fully qualified domain name (FQDN) identified the device
as an iPad.
The FQDN usually won't identify the type of device so clearly, but a check
of the MAC address may indicate the device was manufacturered by Apple. You
can get the MAC address using the
arp command.
$ ping -c 1 192.168.196.212
PING 192.168.196.212 (192.168.196.212): 56 data bytes
64 bytes from 192.168.196.212: icmp_seq=0 ttl=64 time=45.140 ms
--- 192.168.196.212 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 45.140/45.140/45.140/0.000 ms
$ nslookup 192.168.196.212
Server: 192.168.10.134
Address: 192.168.10.134#53
212.196.168.192.in-addr.arpa name = Margarets-iPad.abc.example.com
$ arp Margarets-iPad.abc.example.com
margarets-ipad.abc.example.com (192.168.196.212) at 78:7b:8a:55:bb:35 on en0 ifscope [ethernet]
$
[ More Info ]
[/os/os-x]
permanent link
Mon, May 14, 2018 11:09 pm
Using local time for date calculations in SQLite
I have an
SQLite database that I use to track approval of tasks. Every Monday,
I need to generate a count of the number of tasks approved from the prior
Tuesday through the Monday on which I'm creating the report. The approval
dates are stored in the database as an integer and I enter them in the
form 2018-05-14
. I use the following
SQL command in a
Python script to determine the number I've approved
in the last week:
sql = 'SELECT COUNT(*) FROM Tasks WHERE Approved >= date(CURRENT_DATE,"-6 day")'
But I noticed that the count didn't always include the tasks I approved
on the prior Tuesday. E.g., when I ran the script tonight, May 14, the number
reported was 5, yet I expected the result to be 7.
[ More Info ]
[/software/database/sqlite]
permanent link
Sun, May 13, 2018 9:55 pm
WinPython - Python for Microsoft Windows
If you wish to run
Python on a
Microsoft Windows system, you can use
WinPython.
The first window you will see when run run the downloaded installation file is
one for the license agreement, which notes
"WinPython components are distributed as they were received from their
copyright holder, under their own copyright and/or license, and without any
linking with each other." WinPython itself uses the
MIT
license. Once you accede to the license, you will be prompted for a
destination folder. By default that will be a WinPython directory created
beneath the directory where you're running the downloaded file from,
but you can change the location. When the installation has been
completed, a window will appear where you can click on a Finish
button to exit from the installation program.
[ More Info ]
[/languages/python]
permanent link
Sat, May 12, 2018 8:58 pm
Undo and Redo in Microsoft Windows File Explorer
If you wish to undo or redo an operation you just performed in the
Microsoft Windows
File Explorer on a Windows 10 system, you can do so by
hitting
Ctrl+Z (hit the
Ctrl and
Z keys
simultaneously). E.g., if you inadvertently deleted a file, sending it to the
recycle bin, you can hit those keys together to restore the file to its
prior location. If you wanted to redo an operation you undid, you can
hit
Ctrl+Y to redo the previously undone operation. E.g., if I deleted
a file, then undeleted it with
Ctrl+Z, I could redo the delete
action by hitting
Ctrl+Y sending it back to the recycle bin.
If you wish, you can add undo and redo icons to the Quick Access Toolbar
at the top of the Explorer window by clicking on the icon of a downward
pointing arrowhead with a horizontal line above it that appears at the
top of the Explorer window. You can then select "Undo" and "Redo" from
the menu that appears. Select both, so that you see checkmarks next to
each of those options. You should then see curved Undo and Redo arrows
next to the button you clicked on for the Customize Quick Access Toolbar.
You can now use those arrows, in addition to the shortcut keys, if you
prefer to undo and redo actions in the File Explorer.
[ More Info ]
[/os/windows/win10]
permanent link
Mon, May 07, 2018 11:42 pm
Performing a bare metal backup on a Windows 10 system
If you want to perform a "bare metal" backup of a Microsoft Windows 10 system
to an external USB
drive without a third-party application, you can use the
Backup and Restore utility that is provided by Microsoft with the
operating system. You can run the program from a command-line interface
(CLI) by
opening a command prompt window with
administrator privileges and issuing the command wbadmin start
backup -backupTarget:x -allcritical -quiet
where x
is the drive letter for the drive where you wish to store the backup.
When you add the -quiet
option, the backup will be run with no
prompts for the user. The --allcritical
option "creates a backup
that includes all critical volumes (critical volumes contain the operating
system files and components)."
[ More Info ]
[/os/windows/commands]
permanent link
Privacy Policy
Contact