Mon, Aug 31, 2015 10:28 pm
Viewing information about MySQL and MariaDB databases and tables
MySQL and
MariaDB, which is a
fork
of MySQL are
relational database management systems that share a common command syntax.
For both, you can see available databases with the command
show
databases
.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| ann |
| crystal |
| grover |
| horticulture |
| justiceleague |
| maker |
| mars |
| moon |
| orwell |
+--------------------+
10 rows in set (0.09 sec)
MariaDB [(none)]>
You can see the tables within a particular database by selecing the database
with use dbname
, where dbname is the name of the
database, and then using show tables;
.
MariaDB [(none)]> use crystal
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [crystal]> show tables;
+---------------------------+
| Tables_in_crystaltokyo |
+---------------------------+
| smf_admin_info_files |
| smf_approval_queue |
| smf_attachments |
| smf_ban_groups |
| smf_ban_items |
| smf_board_permissions |
| smf_boards |
| smf_buddies |
| smf_calendar |
| smf_calendar_holidays |
| smf_categories |
| smf_collapsed_categories |
| smf_custom_fields |
| smf_gallery_cat |
| smf_gallery_comment |
| smf_gallery_pic |
| smf_gallery_report |
| smf_group_moderators |
| smf_hcb_reminders |
| smf_links |
| smf_links_bans |
| smf_links_categories |
| smf_links_comments |
| smf_log_actions |
| smf_log_activity |
| smf_log_banned |
| smf_log_boards |
| smf_log_comments |
| smf_log_digest |
| smf_log_errors |
| smf_log_floodcontrol |
| smf_log_group_requests |
| smf_log_httpBL |
| smf_log_karma |
| smf_log_mark_read |
| smf_log_member_notices |
| smf_log_notify |
| smf_log_online |
| smf_log_packages |
| smf_log_polls |
| smf_log_reported |
| smf_log_reported_comments |
| smf_log_scheduled_tasks |
| smf_log_search_messages |
| smf_log_search_results |
| smf_log_search_subjects |
| smf_log_search_topics |
| smf_log_spider_hits |
| smf_log_spider_stats |
| smf_log_subscribed |
| smf_log_topics |
| smf_mail_queue |
| smf_membergroups |
| smf_members |
| smf_message_icons |
| smf_messages |
| smf_moderators |
| smf_openid_assoc |
| smf_package_servers |
| smf_permission_profiles |
| smf_permissions |
| smf_personal_messages |
| smf_picture_comments |
| smf_pm_recipients |
| smf_pm_rules |
| smf_poll_choices |
| smf_polls |
| smf_profile_albums |
| smf_profile_comments |
| smf_profile_pictures |
| smf_scheduled_tasks |
| smf_sessions |
| smf_settings |
| smf_smileys |
| smf_spiders |
| smf_subscriptions |
| smf_tags |
| smf_tags_log |
| smf_themes |
| smf_topics |
+---------------------------+
80 rows in set (0.00 sec)
MariaDB [crystal]>
You can view details on the columns in a particular table by using
DESCRIBE tablename
where tablename
is the
name of the table.
MariaDB [crystal]> DESCRIBE smf_smileys;
+--------------+----------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+----------------------+------+-----+---------+----------------+
| id_smiley | smallint(5) unsigned | NO | PRI | NULL | auto_increment |
| code | varchar(30) | NO | | | |
| filename | varchar(48) | NO | | | |
| description | varchar(80) | NO | | | |
| smiley_row | tinyint(4) unsigned | NO | | 0 | |
| smiley_order | smallint(5) unsigned | NO | | 0 | |
| hidden | tinyint(4) unsigned | NO | | 0 | |
+--------------+----------------------+------+-----+---------+----------------+
7 rows in set (0.05 sec)
MariaDB [crystaltokyo]>
You can also use EXPLAIN tablename
, since EXPLAIN
and DESCRIBE
are synonyms, but the DESCRIBE keyword is
more often used to view information about a table's structure, whereas EXPLAIN
is more often used to obtain a query execution plan, i.e., an explanation of
how MySQL would execute a query.
References:
-
Showing all MySQL databases or all tables in a database
Date: July 27, 2014
MoonPoint Support
-
MySQL :: MySQL 5.0 Reference Manual :: 13.8.2 EXPLAIN Syntax
MySQL :: Developer Zone
[/software/database/mysql]
permanent link
Sat, Aug 29, 2015 10:44 pm
Install MOD Stop Spammer v2.3.9 in other themes
The
Stop
Spammer mod can be used on a
Simple
Machines Forum (SMF) site in conjuction with the
httpBL mod to deny spammers
access to a forum. The package uses the
Stop Forum Spam site's database of spammers, which tracks IP addreses,
email addresses and usernames used by forum spammers.
To use the package, you need to obtain an API key from the
Stop Forum Spam site; you will provide that key at the settings page for
the mod once you have installed the package. You can view your keys at the
Stop Forum Spam API Keys page.
When you install the package, you can choose to install it for some or all
of the themes installed on the site. During the installation, the following
three files will be installed in the images/icons/
directory for
the themes that you choose during the Stop Spammer mod installation:
moreinfo.gif
spammer.gif
suspect.gif
E.g., if I chose to install the mod for the
"Blue
Moonlight" theme, the following would appear during the installation
process:
Blue Moonlight |
Extract File |
./Themes/Blue_Moonlight_SMF2/images/icons/spammer.gif |
Extract File |
./Themes/Blue_Moonlight_SMF2/images/icons/suspect.gif |
Extract File |
./Themes/Blue_Moonlight_SMF2/images/icons/moreinfo.gif |
You can get to the setings page for the package by putting
index.php?action=admin;area=regcenter;sa=settings
at the end
of the URL for the forum.
[/network/web/forums/smf]
permanent link
Thu, Aug 27, 2015 10:37 pm
httpBL Viewlog Error
Tonight I finally had time to locate and fix the cause of a viewlog error
message I had been seeing when attempting to view the httBL logs for a
Simple Machines Forum (SMF) site.
The problem was caused by the
httpBL.template.php
file in the
Themes/default
directory being empty, i.e., a zero byte file.
When I replaced it with the file by that name from the zip file I downloaded
to use for the httpBL installation, the problem disappeared.
[ More Info ]
[/network/web/forums/smf]
permanent link
Wed, Aug 26, 2015 10:07 pm
Safari - Certificate has an invalid issuer
When I put in the HTTPS URL for a website in Safari, I saw the message below:
Safari can't verify the identity of the website "example.com".
The certificate for this website is invalid. You might be connecting to a
website that is pretending to be "example.com", which could put your
confidential information at risk. Would you like to connect to the website
anyway?
|
[ Show Certificate ] [ Cancel ] [ Continue ]
|
When I clicked on Show Certificate, I saw "This certificate has
an invalid ussuer.
Since this was a trusted work site, I downloaded a
.p7b file containing the
issuer certificate. I then opened the Keychain Access app,
which is in Applications/Utilities, then clicked on File,
then Import Items, then selected the .p7b file I downloaded.
I then no longer saw the certificate warning message in Safari. I
didn't have to restart Safari to have it recognize the website's
certifcate as valid.
A .p7b extension is used for
X.509 certificates. X.509 is a
public key
infrastructure (PKI) standard which specifies standard formats for
public key
certificates,
certificate
revocation lists,
authorization
certifcates, and a
certification path validation algorithm.
[/network/web/browser/safari]
permanent link
Sun, Aug 23, 2015 9:31 pm
Problems encountered when installing httpBL
To combat forum spammers attempting to register on a
Simple Machines Forum (SMF) site, I
installed the
httpBL
package (also available from the
SMF mods
page on this site). The mod uses the http:BL API from
Project Honey Pot to stop
spammers from accesing your forum. Instructions for installing and using
it are at
Adding httpBL
to Block Forum Spammers.
I encountered several problems while installing the package. The first one
was when I attempted to install it for all themes on the site. I had installed
18 additional themes for the site. The install process indicated an issue with
only one of the themes, the
Excellent Love theme. An install test failed for that theme. When I
investigated the cause of the problem I found it was due to a file in the
theme having line endings appropriate for a text file on a Mac OS X system,
but I was installing it on a Linux system. I resolved that problem by converting
the line endings, i.e, the "newlines", in the file to the appropriate one for
a Linux system as explained in
Test failed for Excellent
Love theme for httpBL install.
After resolving the problem with the theme, I encountered another problem
installing the software. I saw a
Database Error
message stating that the log_httpBL
table didn't exist for
the forum, which took me a long time to track down and fix.
Then once I had the software installed and the mod's page indicated
it was working ok, when I attempted to view the httpBL logs by going
to the Administration Center then selecting Members, then
MOD httpBL, and then selecting one of the logs, or from the MOD
httBL page when I selected Spammers Log, Humans Log, or Errors Log,
I saw the following error message:
An Error Has Occurred!
Unable to load the 'viewlog' template.
Checking for where the error mesage might be found, I saw the following:
$ grep -rwl "Unable to load" --include=*.php
Sources/Load.php
Themes/default/languages/index.english.php
The error message is coming from
Themes/default/languages/index.english.php
. In that file, I see
the following:
$txt['theme_template_error'] = 'Unable to load the \'%1$s\' template.';
When I checked to see where theme_template_error
occurred, I
found the following:
$ grep -rwl "theme_template_error" --include=*.php
Sources/Load.php
Themes/default/languages/index.english.php
The Project Honey
Pot site is unavailable at the moment. If I visit the website at
www.prjecthoneypot.org, I see
the following error message:
502 Bad Gateway
nginx/0.7.65
Since the httpBL mod logs contain information on IP addresses retrieved
from the Project Honey Pot dabase, perhaps because the site is unavailable the
logs can not be displayed at the moment.
Update: when the Project Honey Pot site became available again I still
experienced the problem viewing the httpBL logs. I finally traced the cause
of the problem to a zero
byte httpBL.template.php file. Replacing that file fixed the problem.
[/network/web/forums/smf]
permanent link
Sat, Aug 22, 2015 10:31 pm
Forum Spammers
After setting up a
Simple Machines Forum
(SMF) site, I found a
spammer registered from a Ukrainian IP address before I even registered
the administrator account for the forum. I changed the forum configuration
so that new members must be approved by the administrator and then installed
themes for the
forum. When I had completed installing themes, I noticed an attempt to
register on the forum by five other spammers.
ID | username | Email Address | IP Address |
5 | boersmaizc |
solanonicole120@gmail.com |
193.201.224.158 |
6 | gjssknua | ehdazusmm@gmail.com |
46.151.52.63 |
7 | KennethFERM |
sepetriw@yandex.com |
193.201.224.171 |
3 | vsrvrzune |
ybficpefo@gmail.com |
46.151.52.35 |
4 | yadiragoldieu1a |
andarytsq@outlook.com |
142.54.185.122 |
When I searched the Stop Forum
Spam site, I didn't find the username boersmaizc
listed, but
I did find the email address listed with many entries from the IP address
193.201.224.158 listed. The IP address is assigned to OpaTelecom in
Ukraine. There were many
instances of the solarnicole email address being used by the spammer from
the 193.201.224.158 address, but also instances of that email address being
associated with IP addresses in Argentina (190.221.23.158), China
(119.253.252.22, 112.20.190.20, 117.185.124.73, 115.28.39.12, 120.198.245.36,
117.177.243.43, and 122.89.138.111), Finland (109.70.176.1),
France (212.129.21.28), Hong Kong (182.239.127.140), Kahzakhstan
(82.200.245.107), Russia (78.25.98.250), Thailand (203.190.251.116), and
the United States (209.66.200.64) -
PDF.
The IP address in France was marked as "Toxic IP address or "bad" email domain".
There was another Ukrainian IP address in the list, 193.201.224.171, in the
same block of IP addresses,
193.201.224.0 - 193.201.227.255.
Another Ukrainian IP address on the list was 46.151.52.63. A search
at the Réseaux IP Européens
website revealed that IP address was assigned to PE Radashevsky Sergiy
Oleksandrovich (ISP ReedLan). RIPE is the
regional
internet registry for Europe, Russia, the Middle East, and Central Asia.
Another Ukrainian IP address, 46.151.52.35, from the same
46.151.48.0 - 46.151.55.255 block of addresses was in the list.
The remaining IP address was 142.54.185.122, which the
American Registry for Internet Numbers (ARIN), a RIR, linked to Zhou
Pizhong in North Kansas City, Missouri.
A Stop Forum Spam search
showed many entries for that IP address, which it associated with the
United States, for August 22 with many prior entries as well.
All of the entries were awaiting membership approval; I deleted all of them.
When I did so, I noticed another attempt to register from a
Ukrainian IP address, 46.151.52.37. I deleted that one as well.
[/network/web/forums/smf]
permanent link
Sat, Aug 22, 2015 12:37 pm
Ukrainian forum spammer at 46.151.52.64
I set up a
Simple Machines Forum (SMF)
forum today using SMF 2.0.10, the latest supported release of the
software. When I logged into the forum immediately after setting it up
there was already one spam posting, which was a long block of text with
many spam links within it.
When I viewed the member information for the spammer, I saw the following:
Username: | uwzedekzk |
Website: | http://www.true-religion.us.org/ |
ICQ: |
http://www.icq.com/whitepages/about_me.php?uin=510521626 |
MSN: | http://members.msn.com/prtazkixe@gmail.com |
In the spam posting, I found a link to the website from "true religion jeans
outlet" along with a lot of other links.
When I checked the spammer's profile information, I saw the following:
Username: | uwzedekzk |
Posts: | 1 (N/A per day) |
Email: | jyhnjknmo@gmail.com |
Gender: | Male |
Age: | 31 |
Location: | Brazil |
|
Date Registered: | Today at 08:32:47 AM |
IP: | 46.151.52.64 |
Hostname: | |
Local Time: | August 22, 2015, 09:44:49 AM |
Last Active: | Today at 08:32:52 AM |
The signature the spammer had on his profile was "oakley glasses" which
was a link to http://www.oakley-sunglass.us.org/. The registration time for
the spammer was listed as 8:32:47 AM. When I checked the registration time
for the administrator account I created when setting up the forum, it was
08:34:58 AM, so the spammer posted two minutes prior even to the registration
of the administrator account.
The 2.1 version of SMF allows one to restrict registrations during the
installation process to require admin approval, but that isn't part of the
installation procedure for 2.0 versions. Instead, you need to log into the
forum as an administrator after installing the software and change the
registration option so that members can't register immediately. I did
change the setting immediately after logging in as the administrator to
Admin Approval by clicking on Admin, selecting Features
and Options, then Members , then Registration, then
Settings. The choices for registration are as follows:
- Immediate Registration
- Email Activation
- Admin Approval
- Registration Approval
With "Immediate Registration" as the default option when the forum software
is installed, spammers can post spam if you don't act quickly to change the
option. But even though I logged in as the administrator immediately after
completing the installation and changed the option, I was still too late
to prevent this particular spammer from posting spam.
On the profile page for the spammer, I selected Actions
and then Ban this user. I then selected an expiration period
of Never for a full ban for the spammer. For Triggers,
I left "Ban on Email Address (e.g. *@badsite.com)" selected with the
email address he used and also left "Ban on Username" selected with his
username, uwzedekzk. I also selected "Ban on IP (e.g., 192.168.10-20.*)"
selected for his IP address, which was 46.151.52.64. Then from his
profile page, I again selected Actions and then chose "Delete
this account".
When I performed a Stop Forum
Spam site search, I didn't find the spammer's username nor email address
listed, but I found a large number of entries for the IP address for August
22, 2015. The spammer used many usernames where the names were just random
strings of characters and the email addresses likewise used random strings
of characters, but all using "@gmail.com". The Stop Forum Spam
Contry Check - Ukraine
page currently shows "7775469 entries in our database from Ukraine
(20.31 percent of total)", i.e., about 1/5 of forum spam is originating from
Ukrainian spammers. The
Spam sources by country page currently shows that their statistics for
the last year show spam originating from Ukrainian IP address space in 51.7%
of the spam reports (PDF).
Since the spammer uses random email addresses and usernames,
I removed the email check from the SMF spammer check, leaving just
the IP address check by selecting Members and then Ban
list. The Stop Forum Spam site search reported "Found 1000 entries
for "46.151.52.64". I saw a prior incident with a Ukraninian forum spammer
r little over 5 years ago, in July of 2010, when a
Ukrainian spammer
manged to post spam to one of my wife's forums.
[/network/web/forums/smf]
permanent link
Tue, Aug 18, 2015 9:38 pm
Counting number of cells with date before or equal to today
If you have a range of cells in an Excel worksheet that contain a date and
you wish to obtain a count of the number of those cells that have a date
that is prior to or equal to today, you could use the formula below, presuming
the relevant cells containing the date are in the range E2:E810:
COUNTIF(E2:E810,"<="&TODAY())
The ampersand concatenates today's date after the <=
.
If you wanted a count for only those dates prior to today, but not including
today, you could replace the <=
with <
.
If you need to count cells based on multiple criteria, you can use
COUNTIFS
. E.g., if for the above range of cells I want to
count the number of cells that not only have a date prior to or equal to today,
but only count the cells if there is some value in another cell in
the row, i.e., if the date in column E is prior or equal to today and there is
some value in column P in that row, i.e., column P is not blank, I can use
the formula below:
=COUNTIFS(E2:E810,"<="&TODAY(), P2:P810, "<>"&"")
E.g., I need to track when an expiration date stored in column E for an
item has passed, but I only want to count the entries when I've contacted the
user associated with the item notifying him that he needs to renew the item.
In column P in the worksheet, I store the date I contacted the user. If I
haven't yet contacted the user, the cell is empty.
I also want to now how many expiration notices I sent today, so use the
formula below for that number:
=COUNTIFS(E2:E810,"<="&TODAY(), P2:P810, "="&TODAY())
The formula checks the values in column E from E2 to E810 to determine
if the date in those cells is less than or equal to today and, if so,
whether today's date is in the corresponding cell in column P. If both
criteria are met, then the count is incremented by 1.
References:
-
Countif greater than or equal to a date
Date: February 13, 2015
MoonPoint Support
-
Excel countifs function
Date: March 14, 2014
MoonPoint Support
-
COUNTIF in Excel - count if not blank, greater than, duplicate or unique
By:
Svetlana Cheusheva
AbleBits
[/os/windows/office/excel]
permanent link
Sun, Aug 16, 2015 11:00 pm
Obtaining BIOS information in Microsoft Windows
If you need to obtain information regarding the BIOS in a system running
a Microsoft Windows operating system (OS), you can do so from a command
prompt using the
wmic
command. E.g. to obtain the BIOS version,
you can use
wmic bios get smbiosbiosversion
. You can also use
the
wmic bios get biosversion
command, which may also
show the BIOS date, depending on the BIOS manufacturer. Other commands that
you can run are
systeminfo | find "BIOS"
and
msinfo32
.
The latter command will open a window showing BIOS information along with a
plethora of other information.
[ More Info ]
[/os/windows/utilities/sysmgmt]
permanent link
Sat, Aug 15, 2015 9:34 pm
Locating the database used for an SMF forum
You may occasionally need to know the name of the database used
for
Simple Machines Forum (SMF)
installation, e.g., perhaps while troubleshooting a problem or if you need
to modify an entry in a table or remove all of the tables for the forum with
phpMyAdmin.
To identify the database, in the directory where the forum files are
stored, look for
Settings.php
. Look for the "Database Info"
section in the file:
########## Database Info ##########
$db_type = 'mysql';
$db_server = 'localhost';
$db_name = 'jane_smf';
$db_user = 'jane';
$db_passwd = 'ASecretPwd';
$ssi_db_user = '';
$ssi_db_passwd = '';
$db_prefix = 'janeswebsite_';
$db_persist = 0;
$db_error_send = 0;
In the above example, I can see that the database name is jane_smf
and that the userid for access to the database through
MySQL or
MariaDB is
jane
with a password of ASecretPwd
. Within the
jane_smf
database, the tables for her forum begin with
janeswebsite_
. One database could be used for multiple forums
with the tables for each beginning with a specific database prefix.
If you do need to remove all of the tables beginning with a specific
prefix from a database, e.g., in the case where a database is used for
multiple forums, you can use the instructions at
Dropping tables with a
similar prefix from a MySQL database to remove just those for a specific
forum.
[/network/web/forums/smf]
permanent link
Wed, Aug 12, 2015 11:00 pm
Changing the SSH listening port on OS X
Mac OS X systems have a
/etc/sshd_config
file for configuring
SSH server settings just as one finds on Linux/Unix systems. On a
Linux or Unix system, you can edit that file and change the
Port
line to change the listening port for the SSH
daemon
from the standard port of 22 to some other port. On Linux/Unix systems
you will find the following line in the file:
#Port 22
To change the port on which the system listens for SSH connections from
SSH clients, you merely remove the "#" from the beginning of the line,
which signifies the line is a comment, and repace "22" with the new port
you wish to use for SSH connections and then restart the SSH server
service.
You can do the same on an Apple OS X system, but the change will have
no effect on the port the SSH daemon will listen on, which you can verify
using the netstat
command, which will still show the
system listening on the standard SSH port.
$ netstat -a | grep ssh
tcp4 0 0 *.ssh *.* LISTEN
tcp6 0 0 *.ssh *.* LISTEN
To change the listening port on an OS X system, you must, instead, edit
/System/Library/LaunchDaemons/ssh.plist
. E.g., if you use
the vi text editor, you
can use the following command:
sudo vi /System/Library/LaunchDaemons/ssh.plist
In the file, you will see the following section:
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>ssh</string>
Replace the ssh
in the line
<string>ssh</string>
with the new port you wish to use, e.g., 50022
. To prevent
confusion later, it is probably best not to use a
well-known port number, i.e., it is probably better to pick a port above
1,023. And you may also want to avoid using a
registered port, since those are ports commonly used by a variety of
applications. Registered ports are those from 1,024 to 49,151.
Once you've replaced "ssh" with a nonstandard port number in
ssh.plist
, you need to restart the SSH server service, which
you can do with the following two commands:
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist
You can then verify that the SSH service is listening on the new port
with the netstat
command. E.g., if you selected 50,022 for
the new port, you could use the command below:
$ netstat -an | grep 50022
tcp6 0 0 *.50022 *.* LISTEN
tcp4 0 0 *.50022 *.* LISTEN
Note: you can't use the launchctl stop
and launchctl
start
commands to stop and restart the SSH server service regardless
of whether it is listening on a standard or nonstandard port. You won't
see any error messages, but the commands will have no effect as you can
check by issuing a netstat command after the stop command.
$ sudo launchctl stop com.openssh.sshd
$ netstat -a | grep ssh
tcp4 0 0 *.ssh *.* LISTEN
tcp6 0 0 *.ssh *.* LISTEN
$ sudo launchctl start com.openssh.sshd
$
[/os/os-x]
permanent link
Sat, Aug 08, 2015 11:00 pm
Booting a Dell Dimension 2400 from a USB flash drive
To boot a Dell Dimension from a USB flash drive, for example a Clonezilla
Live USB drive, connect the USB flash drive, power on the system, then hit
F12 to get the boot menu when you see the Dell logo. From the
boot device menu, select "USB Flash Device".
Boot Device Menu
================
1. Normal
2. Hard-Disk Drive C:
3. IDE CD-ROM Device
4. Diskette Drive
5. USB Flash Device
6. System Setup
7. IDE Drive Diagnostics
8. Boot to Utility Partition
Enter a choice: 1
You can configure the system to always attempt to boot from a USB
device before the hard disk drive (HDD) by hitting F2 when
you power on the system and the Dell logo appears to enter the BIOS
setup. Under Hard-Disk Drive Sequence, you can put "USB Device"
at the top of the list, if you wish by using the "+" or "-" keys to
rearrange the order in which the BIOS will choose boot devices. You will
need to put "USB Device" prior to "System BIOS boot devices" to have
the system attempt to boot from a USB drive first. You can select
"USB Device" and use the minus key to move it to be entry 1 in the list.
1. USB Device |
2. System BIOS boot devices |
3. Hard disk drive (not installed) |
[/pc/hardware/dell]
permanent link
Fri, Aug 07, 2015 7:21 pm
Obtaining hard disk drive and optical drive information on an Ubuntu system
On a Ubuntu Linux system, you can determine the hard disk drive (HDD) serial
number, disk capacity, and manufacturer with the command
sudo lshw
-class disk
:
$ sudo lshw -class disk
[sudo] password for jdoe:
*-disk
description: ATA Disk
product: QUANTUM FIREBALL
vendor: Quantum
physical id: 0
bus info: scsi@0:0.0.0
logical name: /dev/sda
version: A35.
serial: 186021137091
size: 27GiB (30GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 signature=59915410
*-cdrom
description: SCSI CD-ROM
physical id: 1
bus info: scsi@1:0.0.0
logical name: /dev/cdrom
logical name: /dev/sr0
capabilities: audio
configuration: status=nodisc
$
You can obtain information on an optical drive, such as a CD-ROM or DVD
drive using the dmesg
command. Piping the output to egrep
allows you to filter out extraneous data.
$ dmesg | egrep -i 'cdrom|dvd|cd/rw|writer'
[ 1.183545] sr0: scsi3-mmc drive: 48x/48x cd/rw xa/form2 cdda tray
[ 1.183556] cdrom: Uniform CD-ROM driver Revision: 3.20
$
From the above output, I can see the read and write speed for the CD/RW
drive in the system is 48 speed.
You can also obtain the speed of the drive by examining the contents of
/proc/sys/dev/cdrom/info
.
$ cat /proc/sys/dev/cdrom/info
CD-ROM information, Id: cdrom.c 3.20 2003/12/17
drive name: sr0
drive speed: 48
drive # of slots: 1
Can close tray: 1
Can open tray: 1
Can lock tray: 1
Can change speed: 1
Can select disk: 0
Can read multisession: 1
Can read MCN: 1
Reports media changed: 1
Can play audio: 1
Can write CD-R: 0
Can write CD-RW: 0
Can read DVD: 0
Can write DVD-R: 0
Can write DVD-RAM: 0
Can read MRW: 1
Can write MRW: 1
Can write RAM: 1
$
You can obtain the manufacturer and model number for a CD-ROM, CD/RW, or
DVD drive using the cd-drive
utility from the libcdio-utils
package. If it isn't installed, you can install it on an Ubuntu
system with sudo apt-get install libcdio-utils
.
$ cd-drive
The program 'cd-drive' is currently not installed. You can install it by typing:
sudo apt-get install libcdio-utils
$ sudo apt-get install libcdio-utils
Once you've installed the package, you can view vendor, model number,
and other information for the drive, including functions the drive supports
by issuing the command cd-drive
.
$ cd-drive
cd-drive version 0.83 i686-pc-linux-gnu
Copyright (c) 2003, 2004, 2005, 2007, 2008, 2011 R. Bernstein
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
The driver selected is GNU/Linux
The default device for this driver is /dev/cdrom
Drivers available...
GNU/Linux ioctl and MMC driver
cdrdao (TOC) disk image driver
bin/cuesheet disk image driver
Nero NRG disk image driver
CD-ROM drive supports MMC 3
Drive: /dev/cdrom
Vendor : HL-DT-ST
Model : CD-ROM GCR-8483B
Revision : 1.05
Profile List Feature
Core Feature
ATAPI interface
Morphing Feature
Operational Change Request/Notification not supported
Synchronous GET EVENT/STATUS NOTIFICATION supported
Removable Medium Feature
Tray type loading mechanism
can eject the medium or magazine via the normal START/STOP command
can be locked into the Logical Unit
Random Readable Feature
CD Read Feature
C2 Error pointers are not supported
CD-Text is supported
Initiator- and Device-directed Power Management Feature
Ability to respond to all commands within a specific time Feature
Vendor-specific code ffde Feature
Hardware : CD-ROM or DVD
Can eject : Yes
Can close tray : Yes
Can disable manual eject : Yes
Can select juke-box disc : No
Can set drive speed : No
Can read multiple sessions (e.g. PhotoCD) : Yes
Can hard reset device : No
Reading....
Can read Mode 2 Form 1 : Yes
Can read Mode 2 Form 2 : Yes
Can read (S)VCD (i.e. Mode 2 Form 1/2) : Yes
Can read C2 Errors : No
Can read IRSC : Yes
Can read Media Channel Number (or UPC) : Yes
Can play audio : Yes
Can read CD-DA : Yes
Can read CD-R : Yes
Can read CD-RW : Yes
Can read DVD-ROM : No
Writing....
Can write CD-RW : No
Can write DVD-R : No
Can write DVD-RAM : No
Can write DVD-RW : No
Can write DVD+RW : No
$
In the above example, I can see the drive model number is
GCR-8483B
, so can look online for futher information that might
be available from the manufacturer, if needed.
Note: all of the above examples were run on a Ubuntu 12.04 LTS system.
[/os/unix/linux/ubuntu]
permanent link
Sat, Aug 01, 2015 10:33 pm
Resetting the mouse in Ubuntu
I could no longer move the mouse pointer on an eMachines netbook system
running Ubuntu 12.04. I could use
Alt-Tab to move between open windows,
but could not move the mouse pointer using the touchpad. Using the
instructions at
Restarting your touchpad/mouse in Ubuntu in simple steps, I used
the
Alt-F2 key combination to obtain a "run a command" field. I tried
gksudo modprobe -r psmouse
then hit
Alt-F2 again and
entered
gksudo modprobe psmouse
but found no difference. I already
had a terminal window open, so I switched to it with
Alt-Tab, though
you can open one by hitting
Alt-F2 and entering
gnome-terminal
. I entered the command
sudo modprobe -r psmouse
there
and provided my password when prompted. The screen then went black for a
moment and I appeared to have been logged off. I provided the login password
for my account, hit
Alt-F2, typed
gnome-terminal
,
then typed
sudo modprobe psmouse
. That restored mouse movement
using the touchpad, though I did see the message "
System program problem
detected Do you want to report the problem now?" I chose to
report the problem. That led to another window opening with the message
"Sorry, Ubuntu 12.04 has experienced an internal error. If you notice
further problems, try restarting the computer." When I chose to look at
details, I saw the following:
Executable Path
/usr/bin/Xorg
Package
xserver-xorg-core 2:1:.11.4-0ubuntu10.13
Problem Type
Xorg crashed with SIGABRT in raise()
.tmp.uity.support.test.0
A crash report for the incident was placed in /var/crash
.
At that point after submitting the report, I decided to reboot.
[/os/unix/linux/ubuntu]
permanent link
Privacy Policy
Contact