Wed, Jan 31, 2018 11:48 pm
Using olefile to obtain metadata from an OLE CDF V2 file
Microsoft's Object Linking and Embedding (OLE) technology allows
embedding and linking to documents and other objects. OLE allows the
addition of different kinds of data to a document from different
applications, such as a text editor and an image editor. This creates
a Compound File Binary Format (CFBF), aka a
Compound File, Compound Document format, or Composite Document File V2 (CDF V2)
document.
While using my MacBook Pro laptop, which is currently running the
OS X El
Capitan (10.11.6) operating system, I often need to
extract embedded documents from an
Excel .xlsm file. I do that by renaming the file to have a .zip rather than
a .xlsm file extension. I can then extract the files contained
within the .zip file just as I would any
zip file. Within the directory structure created by unzipping the
zip file there is an xl/embeddings
subdirectory with .bin
files within it.
$ ls xl/embeddings
Microsoft_Visio_Drawing1.vsdx oleObject2.bin
Microsoft_Visio_Drawing2.vsdx oleObject3.bin
oleObject1.bin
$
[ More Info ]
[/languages/python]
permanent link
Tue, Jan 30, 2018 11:22 pm
Using Python to extract data from a spreadsheet and put it in a database
I need to review spreadsheets related to work requests on a daily basis. The
Excel
workbooks have multiple worksheets within them. I have been manually copying
data from specific cells in one of the worksheets and pasting it into a
SQLite
database. I use DB Browser for SQLite
to paste the information into the database. I wanted to automate the
process of extracting the data from the .xlsm or .xlsx workbook files and
inserting it into the SQLite database using a
Python script. So I initially created a script that I could
run from a Teminal window on my
MacBook Pro laptop,
as noted in
Extracting data from cells in an Excel workbook with Python, that
would just print the information to the Terminal window's command-line
interface. I had another script to
import data from
a text file into an SQLite database with Python, so I combined code from
that script with the one to read data from the spreadsheets to add the data
to a table in the database.
[ More Info ]
[/languages/python/excel]
permanent link
Sun, Jan 28, 2018 10:15 pm
Reading specific lines from a file into another file within Vi
If you need to read lines from another file into the file you are currently
editing within the Vi text editor, you can do so by utilizing the editor's
ability to execute an external command, e.g., a Linux/Unix
shell
command, by entering an
exclamation mark followed by the external command. E.g., if I wanted to
read the first 55 lines from the file ~/temp/lincoln.txt
, I could e
nter Vi's colon mode by hitting Esc followed by the colon character.
I could then type r
, which is the command used to read from
another file. But, instead of immediately typing the file name, e.g.
:r ~/temp/lincoln.txt
, I could use the
head utility to read the
first fifty-five lines of the file by typing head -55
followed by
the path to the file and the file name. E.g.:
:r !head -55 ~/temp/lincoln.txt
If, instead, I wanted to read the last 14 lines of the file, I could use
the tail command.
:r !tail -14 ~/temp/lincoln.txt
If I wanted to include specific lines from the other file into the one I'm
currently editing, e.g., lines 10 through 15, I could use the
sed command as shown below.
:r !sed -n 10,15p ~/temp/lincoln.txt
[ More Info ]
[/software/editors/vi]
permanent link
Sat, Jan 27, 2018 6:50 pm
Turning on UltraVNC server service on a Windows system
If you installed
UltraVNC,
which is
free and open-source software, to provide
Virtual Network Computing (VNC) connectivity from/to
a system for remote administration capabilities, but haven't enabled
the UltraVNC server service to allow the system itself to be managed remotely,
you can enable that service by taking the following steps:
-
Run the
uvnc_settings.exe
program, which you can find in
the directory where you installed UltraVNC. You will need to provide the
login credentials for an account with administrator-level access on the
system.
-
Click on the Service tab then click on the Install Service
button, which will install the software as a service, i.e. as a function
provided by a server, on the system.
-
Once the service is installed, you can click on the Start Service
button to run the service.
-
You can set the password to be used for VNC connections by clicking on
the Security tab. You can set two passwords. The "VNC Password"
will allow remote control of the system whereas the "View-Only Password"
will only allow viewing the display on the system, which is helpful if you
want to show someone what is happening on the system without giving the
person the ability to control the system. You can then click on the
OK button to close the UltraVNC settings window.
[
More Info ]
[/os/windows/software/remote-control/vnc/ultravnc]
permanent link
Fri, Jan 26, 2018 10:51 pm
Extracting data from cells in an Excel workbook with Python
I've been
using xlrd to extract a column from an Excel spreadsheet with a
Python script on my MacBook Pro laptop. With xlrd, you can
read data from cells in a workbook by specifying a specific sheet and the cells
from which you wish to extract the data in
spreadsheet
programs, such as
Microsoft Excel,
Apache OpenOffice Calc, or
LibreOffice Cale.
With spreadsheet applications you normally have rows sequenced by numbers
and columns sequenced by alphabetical characters. With xlrd, though, both
rows and columns are specified by numbers with the first row starting at 0
and the first column starting at 0 as well.
[ More Info ]
[/languages/python/excel]
permanent link
Wed, Jan 24, 2018 10:39 pm
Determine NTP server on a Microsoft Windows system
If you wish to determine the
Network Time Protocol (NTP) server that a Microsoft Windows system is
using to synchronize its time, you can find that information in the
Windows registry at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer
.
You can query that value from a
command-line interface (CLI) with the command reg query
HKLM\System\CurrentControlSet\Services\W32Time\Parameters
. To see
just the NTP server
fully qualified domain name (FQDN), you can
pipe the output of the reg query
command to the
find command and search for "NtpServer".
C:\>reg query HKLM\System\CurrentControlSet\Services\W32Time\Parameters
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W32Time\Parameters
NtpServer REG_SZ time.windows.com,0x9
ServiceDll REG_EXPAND_SZ %systemroot%\system32\w32time.dll
ServiceDllUnloadOnStop REG_DWORD 0x1
ServiceMain REG_SZ SvchostEntry_W32Time
Type REG_SZ NTP
C:\Users\Administrator.LABYRINTH>reg query HKLM\System\CurrentControlSet\Services\W32Time\Parameters | find "NtpServer"
NtpServer REG_SZ time.windows.com,0x9
C:\>
In the above example, the time server is time.windows.com, an NTP server
provided by Microsoft.
[/network/ntp]
permanent link
Tue, Jan 23, 2018 9:42 pm
Using key pairs with SSH
The
Secure Shell (SSH) protocol provides a means one can use for
secure, encrypted connections between systems for logins or file transfers.
One can use a username and password to login from an SSH client to an SSH
server or one can use a
public and private key combination where a public
key for a user's account is stored on a remote SSH server while a corresponding
private key is stored on the system from which the user will initiate the
SSH or SFTP connection. On
Linux systems,
private keys are normally stored in the .ssh
directory
beneath the home directory for your account. If you haven't created
any keys yet, the directory may only contain a known_hosts
file that contains public keys for servers you've previously logged into
via SSH.
[ More Info ]
[/network/ssh]
permanent link
Mon, Jan 22, 2018 5:26 pm
This page intentionally left blank
Books and other documents may often include pages intentionally left blank
stating "This page [is] intentionally left blank." As explained in the Wikipedia
intentionally blank page article, this is often done due to the way
pages are printed from a much larger sheet of paper or for legal reasons.
On the web you can find an online equivalent in
The This Page Intentionally Left Blank (TPILB) Project which notes:
In former times printed manuals had some blank pages, usually with
the remark “this page intentionally left blank”. In most cases there
had been technical reasons for that. Today almost all blank pages disappeared
and if some still exist here and there, they present flatterly comments
like “for your notes” instead of the real truth: This page
intentionally left blank!
Nowadays the “This Page Intentionally Left Blank”-Project
(TPILB-Project) tries to introduce these blank pages to the
Web again. One reason is to keep alive the remembrance of these famous
historical blank pages. But it is the primary reason to offer internet
wanderers a place of quietness and simplicity on the overcrowded World
Wide Web—a blank page for relaxing the restless mind.
Since I sometimes want to take browser screenshots that display
options that are available in various browsers, but would prefer not to
have any webpage content displayed in those screenshots, I've also created a
"this page intentionally
left blank" page.
[/network/web/design]
permanent link
Sun, Jan 21, 2018 10:56 pm
OpenVPN
OpenVPN is
free and open-source software that provides
Virtual Private Network (VPN) connectivity that is available for a variety
of
operating systems. To use the software on a
Microsoft Windows 10 system, download the the installer for
Windows
Vista and later from the OpenVPN
Community Downloads page; get the OpenVPN community software not the
PrivateTunnel software from the OpenVPN project - I mistakenly downloaded
and installed PrivateTunnel when I first went to the
OpenVPN site and then had to
uninstall PrivateTunnel.
[ More Info ]
[/os/windows/network/vpn]
permanent link
Sat, Jan 20, 2018 11:01 pm
Updating Windows Subsystem for Linux
If you
set up the Windows Subsystem for Linux on Windows 10, you may find that
when you subsequently select Bash on Ubuntu on Windows to obtain a
Bash shell
prompt, that you see a message indicating that packages need to be
updated. E.g.:
106 packages can be updated.
71 updates are security updates.
root@ANAHEIM:~#
You can get the updates with apt-get update
.
You can then install the updates with apt-get upgrade
. You may
need to respond to a "Do you want to continue?" prompt. If there are a lot of
updated packages to install, be prepared to wait awhile for the upgrade
process to complete.
[ More Info ]
[/os/windows/win10/Linux-Subsystem]
permanent link
Fri, Jan 19, 2018 8:21 pm
Windows 7 to 10 upgrade hung at "finalizing your settings"
A few days ago I upgraded a Windows 7 Professional system to Windows 10.
After the upgrade was installed, I saw a blue screen with "Finalizing your
setings" with a spinning circle of dots above it. I didn't need to use
the system for a few days, so I left it in that state for about 3 days.
But with the same message displayed today, I was able to resolve the
problem today by holding the power button down for about 15 seconds until
the system powered off. When I powered the system back on afterwards I
saw "Welcome to Windows 10!" with the account I had been logged into
before the upgrade showing and a Next button near the bottom,
right-hand corner of the screen. When I clicked on Next, I saw
the "Choose privacy settings for your device" screen, though I had made
those selections during the upgrade process previously. I altered the
selections again as I had before and then saw a "Meet Cortana" screen
where I clicked on Not now. I then saw "Finalizing your settings"
again briefly and then the screen went black. I saw the disk activity
LED for the laptop blinking rapidly for a minute and then I saw a circle
of spinning dots on a blue background above "Please wait", but then I
got to the "Press Ctrl+Alt+Delete to unlock" screen and was able to log
into the laptop where within a few moments I saw "Thank you for updating
to the latest version of Windows 10. I typed winver
in the
Cortana "Ask me anything" field and hit Enter which resulted in
winver being shown as the best match. When I selected it, I saw
the current version of Windows being displayed as Windows 10 Version 1709
(OS Build 16299.125).
[/os/windows/win10]
permanent link
Thu, Jan 18, 2018 11:55 pm
Viewing the login history for a user on a Linux or OS X system
If you want to see the IP addresses from which logins have occurred on a
Linux or OS X system, you can use the
last command. E.g.:
$ last ann
ann tty2 Thu Jan 5 20:23 - 20:27 (00:03)
ann tty2 Thu Jan 5 20:05 - 20:06 (00:00)
ann tty2 Thu Jan 5 20:01 - 20:02 (00:00)
ann pts/0 8.25.222.2 Sun Oct 30 10:43 - 16:59 (06:16)
ann pts/0 192.168.0.2 Tue Oct 11 12:02 - 12:03 (00:00)
ann pts/0 192.168.0.2 Tue Oct 11 12:01 - 12:01 (00:00)
ann pts/32 192.168.1.6 Sat Jun 11 20:03 - 20:38 (00:35)
ann pts/32 192.168.1.6 Sat Jun 11 13:23 - 14:22 (00:58)
ann pts/14 192.168.1.5 Sun Feb 14 17:05 - 18:28 (6+01:22)
ann pts/6 8.23.51.9 Sun Nov 8 09:23 - 10:16 (00:52)
ann pts/6 8.23.51.9 Sat Nov 7 08:54 - 16:42 (07:48)
ann pts/7 8.23.51.9 Fri Nov 6 16:47 - 16:49 (00:02)
ann pts/6 8.23.51.9 Fri Nov 6 15:48 - 23:33 (07:44)
ann pts/0 :0 Thu Sep 10 15:25 - 12:38 (129+22:13)
ann :0 :0 Thu Sep 10 15:24 - 12:38 (129+22:14)
ann pts/5 :0 Sun Aug 23 11:08 - crash (18+04:03)
ann pts/4 :0 Sat Aug 22 21:16 - crash (18+17:56)
ann pts/3 :0 Sat Aug 22 09:14 - crash (19+05:58)
ann :0 :0 Sat Aug 22 09:07 - crash (19+06:05)
ann pts/2 192.168.1.6 Sun Jul 19 15:41 - 20:59 (1+05:18)
ann pts/2 192.168.1.5 Mon Jun 22 21:28 - 20:17 (18+22:49)
ann pts/2 192.168.1.6 Fri Feb 6 21:26 - 21:26 (00:00)
ann pts/5 192.168.0.3 Wed Nov 5 21:07 - 22:15 (01:08)
wtmp begins Sun Oct 5 20:09:11 2014
$
[ More Info ]
[/os/unix/commands]
permanent link
Wed, Jan 17, 2018 11:01 pm
Renewing a DHCP lease under OS X
If you wish to renew a
Dynamic Host Configuration Protocol (DHCP) lease on a Mac
OS X
system, you can do so by clicking on the Apple icon in the upper, left-hand
corner of the screen, selecting System Preferences, and then Network
, and then the relevant network interface, e.g., Wi-Fi.
Then click on the Advanced button and then the TCP/IP tab.
You can then click on the Renew DHCP Lease button to have the system
attempt to renew its DHCP lease.
[ More Info ]
[/os/os-x]
permanent link
Tue, Jan 16, 2018 10:30 pm
Can't insert worksheet in Microsoft Excel for Mac 2016
When I tried to insert another worksheet in an Excel workbook today, I found
that the option to insert a new blank worksheet was grayed out when I clicked on
Insert and selected
Sheet.
When I tried another means of adding a new sheet by clicking on
the plus sign at the right side of the list of sheets in the worksheet
to add the sheet, I saw an alert message stating "Workbook is protected
and cannot be changed."
[ More Info ]
[/software/office]
permanent link
Mon, Jan 15, 2018 7:37 pm
Using the Windows Resource Monitor to monitor network activity
If you want to see the IP addresses to which a program on a Microsoft Windows
system is establishing connections, you can use the
Resource Monitor utility that is provided with
Windows
Vista and later versions of Windows to check on network connections from
a particular application on the system. To start the program, you can click
on the Windows
Start button and type resmon
or resmon.exe
in the "Search programs and files" field on a Windows 7 system or the
"Type here to search" field on a Windows 10 system. You should see the
resmon utility returned as the best match.
When the Resource Monitor program is running, you can click on the
Network tab and then TCP Connections to see network activity
associated with programs currently running on the system . You can click on a
column header, e.g. "Image" to sort the entries by the values in that column.
[ More Info ]
[/os/windows/network/monitoring/resmon]
permanent link
Sun, Jan 14, 2018 11:02 pm
Comodo OCSP
After I started the
gVim text editor on a Windows laptop, I saw a "firewall
alert" from the Symantec antivirus/firewall software on the system stating
"Suspicious network activity has been detected." I've used gVim on many
other systems for many years, but those systems weren't running the Symantec
security software. The Symantec software showed that gvim.exe was attempting
a
Domain Name System (DNS) query to port 53, the
well-known port for DNS, to IP address 8.8.8.8, the
Google DNS
server specified on the system for DNS queries.
[ More Info ]
[/network/ocsp]
permanent link
Sat, Jan 13, 2018 10:20 pm
Using downloaded Visio stencils with Visio 2016
I needed to add a
Juniper SRX Series Services Gateway to a network diagram created with
Microsoft Visio 2016, so I downloaded the SRX Series stencils from
Juniper Networks
Product Icons & Visio Stencils page. The downloaded file was a
ZIP file, so I extracted the contents of that file. Within the .zip file
were two .VSS files:
Juniper Branch SRX Series.vss and
Juniper Data Center SRX Series.vss. On a Microsoft Windows system,
if you wish to make shapes within a .vss file available within Visio, you
can copy the .vss files to the My Shapes
directory within
the Documents
directory for the account you are using. To
then access the shapes, click on More Shapes on the left side
of the Visio 2016 window, then select My Shapes. You should then
see the names for the .vss files you added to the My Shapes
directory listed.
[ More Info ]
[/os/windows/office/visio]
permanent link
Fri, Jan 12, 2018 10:55 pm
Viewing only the files created today on a Linux system
I sometimes need to see only the files created or modified today in a
directory. On a Linux system, you can
pipe
the output of the
ls command
into the grep
command looking for just today's date in the input to the grep command as
shown below:
$ ls -al --time-style=+%D ~/Documents/*.zip | grep $(date +%D)
-rw-r--r--. 1 joe joe 269338 01/12/18 /home/joe/Documents/gloves.zip
$
You can specify how the date is displayed with +format
where format is a particular format in which you want the date
displayed - see
Formatting the output from the date command on a Linux system. If you
use +%D
, the date will be displayed as m/d/y
, i.e.,
month/day/year, e.g. 01/12/18 for January 12, 2018. By then using the
grep command to search for that value, you can limit the displayed files
to only those created or modified today.
[ More Info ]
[/os/unix/commands]
permanent link
Sat, Jan 06, 2018 5:01 pm
Configuring Sendmail to always allow Steam email
A family member wasn't receiving email for a
Steam
account she created to play a
PC game.
Her email comes through a
Sendmail
email server I manage and I found that a
Domain Name
System-based Blackhole List (DNSBL), the
Spam and Open Relay Blocking System (SORBS), had blocked
email from the IP address that
Valve
had for the email server used to send email to her about the account.
When I checked the sendmail log file, I found the following two entries:
Dec 29 21:10:26 moonpoint sendmail[27413]: ruleset=check_relay, arg1=smtp03.stea
mpowered.com, arg2=127.0.0.6, relay=smtp03.steampowered.com [208.64.202.39], rej
ect=550 5.7.1 Spam Block:mail from 208.64.202.39 refused - see http://dnsbl.sorb
s.net/
Dec 29 21:17:35 moonpoint sendmail[27661]: ruleset=check_relay, arg1=smtp01.stea
mpowered.com, arg2=127.0.0.6, relay=smtp01.steampowered.com [208.64.202.37], rej
ect=550 5.7.1 Spam Block:mail from 208.64.202.37 refused - see http://dnsbl.sorb
s.net/
Checking, I found the following IP addresses and
fully qualified domain names (FQDNs) for Steam email
servers:
IP Address | FQDN |
208.64.202.36 |
smtp.steampowered.com |
208.64.202.37 |
smtp01.steampowered.com |
208.64.202.38 |
smtp02.steampowered.com |
208.64.202.39 |
smtp03.steampowered.com |
208.64.202.40 |
steammail.steampowered.com |
To ensure that none of the DNSBLs I use with Sendmail will ever block
email from the Steam email servers, I added the following lines to
/etc/mail/access
:
Connect:208.64.202.36 OK
Connect:208.64.202.37 OK
Connect:208.64.202.38 OK
Connect:208.64.202.39 OK
Connect:208.64.202.40 OK
I then used the makemap hash
command to rebuild the access
database.
# makemap hash /etc/mail/access </etc/mail/access
#
Once I did that, she was able to receive the Steam-related email.
[/network/email/sendmail]
permanent link
Privacy Policy
Contact