Use yum to manage your packages and stop using rpm!

I hate seeing the RPMDB altered message when doing yum updates!

Transaction Summary
=======================================================================================================================
Install 1 Package
Upgrade 1 Package

Total size: 309 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.

For that reason, I tell sysadmins when installing or upgrading rpms to use:

yum -y install <rpm file>

and to use

yum -y remove <rpm name>

to remove the rpm you want.

Solaris pkg upgrade fails with “maximum number of instances of the package which may be supported at one time on the same system has already been met” message

This message is pretty awesome, isn’t it? You can get this message when trying to upgrade a package. At least that’s what happened to me.

username# pkgadd -d .

The following packages are available:

  1  pkgname          pkgname

                          (sparc) version.sol5.sparc

Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]: 1

Processing package instance <pkgname> from </tmp/ven/solaris>

pkgname(sparc) version.sol5.sparc Illumio

Current administration requires that a unique instance of the <pkgname> package be created.  However, the maximum number of instances of the package which may be supported at one time on the same system has already been met.

 No changes were made to the system.

This issue is pretty easy to get around. You just need point your admin file that has the right options. In my case, my admin file needed the instance=overwrite:

mail=
instance=overwrite
partial=ask
runlevel=ask
Require that our dependencies are met when installing.
idepend=quit
However, if someone tries to uninstall us but another package depends on us,
we should just warn them & ask if they want to proceed anyway.
rdepend=ask
space=ask
setuid=ask
conflict=ask
action=nocheck
networktimeout=60
networkretries=3
authentication=quit
keystore=/var/sadm/security
proxy=
basedir=default

If you’re using instance=ask, it works also. It’ll just ask you before overwriting.

Fooling around with pkgadd (Solaris packages)

I basically had a Solaris SVR4 package that I needed to install. I didn’t care if the package worked or not after it installed. This is what happened when it first failed.

pkgadd: ERROR: checkinstall script did not complete successfully

The installer said that I was missing a package, so I went into the pkgname/install/checkinstall script and just commented those lines out. After doing that, this happened.

[email protected]:/tmp# pkgadd -d .
The following packages are available:
1 pkgname pkgname
(i386) version
Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:
Processing package instance from
pkgname(i386) version
company
Executing checkinstall script.
OS Release = 11.4
Processing package information.
Processing system information.
pkgadd: ERROR: packaging file is corrupt
file cksum <26912> expected <26914> actual
Installation of failed (internal error).
No changes were made to the system.

Obviously, there’s some sort of check for integrity of the file. To get around that, I went in and edited the pkgname/pkgmap file to make the changes from 26912 to 26914.

After doing this, the package magically installed. Fun!

Changing root password on Solaris 11.3 x86

I’m posting this only because the process has changed a bit since I did it back in the days. Because I’m not using Solaris on SPARC, there’s no STOP-A, boot -s, etc.

Just like back in the days with Solaris 8, you would need to boot with a cdrom or PXE or jumpstart, whatever method you have. Afterwards, you take the shell option. Obviously, you’re not installing the OS.

Solaris 11 uses ZFS, not UFS so you can’t directly mount a partition. You need import a pool instead.

mkdir /b
zpool import -f -R /a rpool
zfs set mountpoint=legacy rpool/ROOT/solaris
mount -F zfs rpool/ROOT/solaris /b
vi /b/etc/shadow

Edit the shadow file

Find your username and remove the password hash

Change your user id
username:whateverthehashis:12345::::::23456
to
username::12345::::::23456

Then we will need to allow empty passwords at login

$ vi /b/etc/default/login
Change the line:
PASSREQ=YES
to
PASSREQ=NO

umount /b
zfs set mountpoint=/ rpool/ROOT/solaris
zpool export rpool
init 6

When the system boots, you should be able to log in as root and just press return for the password. If you’re logging in through SSH, you won’t need to enter a password.

Hope this saved you some time!

Install .NET 2.0 in Windows 10

What!? Why would you want to do that!? A friend of mine recently brought a computer to me for him to install some old software on. This happened to be some custom software that was written and required .NET 2.0. I tried installing the software and it wouldn’t install because it .NET 2.0 was required and if you go to Microsoft’s website, it looks like the only version you could get is .NET 4.8 and it already came with the OS that his laptop came with! What gives!?

I managed to find this command only that allowed me to continue the install:

DISM /Online /NoRestart /Enable-Feature:NetFx3

Turns out there are tons of YouTube videos and other posts about how to install it. I just didn’t think to look. You could actually just go to the control panel and install it from there as well.

image

Anyway, hope this post can save you some time!

FATAL: invalid value for parameter “TimeZone”: “America/Los_Angeles” with DBeaver

I got that message when trying to use DBeaver to connect to a PostgreSQL DB.

FATAL: invalid value for parameter "TimeZone": "America/Los_Angeles"

I found the fix here. The first thing to check is the timezone you have set on the Postgres db itself. You can do this by running “SELECT * FROM pg_timezone_names;”.

Here’s an example:

avenger_agent_prod=# SELECT * FROM pg_timezone_names;
name | abbrev | utc_offset | is_dst
------+--------+------------+--------
UTC | UTC | 00:00:00 | f
(1 row)

The fix is to make a small change the dbeaver.ini file in DBeaver root directory. If you installed this on a Mac, the file is in /Applications/DBeaver.app/Contents/Eclipse/

Just add:

-Duser.timezone=UTC
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.551.v20171108-1834
-showsplash
# START: change jre version, not using the one in %JAVA_HOME%
-vm 
D:\ArPortable\Java\jdk1.8.0_171\jre\bin\server\jvm.dll
# END
# JVM settings
-vmargs
-XX:+IgnoreUnrecognizedVMOptions
--add-modules=ALL-SYSTEM
-Xms64m
-Xmx1024m
# time zone
-Duser.timezone=UTC
# language
-Duser.language=en

When you restart DBeaver, it should connect.

Don’t buy/give gift cards! Store bought Visa gift cards are unsafe!

Unless someone really wants a gift card like the ones in the photo, I would not recommend it! They’re unsafe and prone to hacking. I’ve been burnt twice now for over $600 with no recourse. I bought these because I wanted to pay off some bills with American Express. Because those providers didn’t take AMEX, I bought Visas to do it with. I left the cards sealed and unopened in my drawer figuring that I would just use them later.

The first time I ran into an issue was when I logged into the website and saw that my $500 gift card had only $2 on it! Turned out that somehow, it was used at Gamestop for $497.xx. I had no idea how that could’ve happened! The card was in my drawer and I had just opened it! I emailed the company to file a dispute and I got this response:

  
CONTENT SOLUTIONS COMPANY
Communication Update    Subject: charge dispute  Hello,   Our team is currently working on your Case CS2767575 and has the below update. Thank you for your patience with this matter.   Comments:
Hello,

As stated in your Account Agreement, account discrepancies are to be communicated to us no later than 60 calendar days after the transaction history was first made available to you. Unfortunately, we did not receive your inquiry within this time limit. We have no recourse to recoup these funds for you.

Therefore, we are unable to credit your account, thus closing this dispute. Although we are not able to assist you further, we urge you to pursue this matter directly with the merchant.

We appreciate your business and value you as a customer. If you have any questions about this matter, please contact our Customer Service Department at the number or website address listed on the back of your card. This inbox is used strictly to receive documentation, or information requested related to the disputes processes. We are unable to provide account or disputes updates and apologize for any inconvenience this may cause.

Thank you,
Customer Dispute Services
   Case Status Tracker (Resolved)    What Next? Our customer service team will reach out to you shortly regarding your issue.     Any Questions?   Click here to reply.                                                                      
 

Sure, I let the card sit in my drawer for a long time, but the card hadn’t expired. How did it get used!?

My best guess as to how the card got used: Their website sucks. Now, it has a little stupid check to see if you’re human – shows you a picture of a toy that you need to rotate and when you finally get it, you could check your cards – register the card to use online, check balance, etc. I think maybe the theft happened prior to this security measure was put in place. Maybe it wasn’t. Anyway, I think someone had a script that generated numbers against their website for CVV matches and return the gift card values.

I was unlucky. Hope you’re not next. If you must buy gift cards, definitely have a plan on using them. If someone gave you one, try to use it asap. Some ideas on how to use them – obviously, it’s best to get cash for them if possible. It’s possible, but not easy. I’ve traveled to different places where Walmart cashiers are oblivious and would sell money orders for them. Most Walmarts will not. I’ve also loaded a bluebird card with one as well. Unfortunately, none around me will do it. I think it’s just how lucky you are. The way I use the cards is by doing my regular spend and all of my bills. T-Mobile takes them, I’ve used them for my water bills and energy bills as well. It’s great that I could use them to the penny.

Hope this helps!

By the way, if you’ve been screwed like me and think this is worthy of a class action lawsuit, please let me know and I would love to join.

How to test open ports w/o telnet or nc

Found this out of necessity when a security team didn’t allow the installation of either telnet or nc. I initially thought ssh would work, but it doesn’t really work.

The command is simple. Just do this:

/dev/tcp/<host>/<port>

Replace the <host> and <port>. Here’s how it would look if successful:

SV-LT-1361:~ altonyu$ > /dev/tcp/192.168.0.11/2049
SV-LT-1361:~ altonyu$ echo $?
0

Here’s how it would look if unsuccessful:

SV-LT-1361:~ altonyu$ > /dev/tcp/192.168.0.11/2047
-bash: connect: Connection refused
-bash: /dev/tcp/192.168.0.11/2047: Connection refused
SV-LT-1361:~ altonyu$ echo $?
1

Obviously if the command hangs, it probably means it won’t work either.

Hope this helps someone!

Use update-ca-trust! Or update-ca-certificates.

Don’t just append the /etc/ssl/certs/ca-certificates.crt or the /etc/ssl/certs/ca-bundle.crt.

Not long ago, I thought that it didn’t matter. I figured since the update-ca-trust command just updated the bundle, I might as well skip a step and go directly. I was wrong. Don’t do it. I guess that’s why people actually have processes and directions to follow.

The reason why you want to put the certificate issuers in /etc/pki/ca-trust/source/anchors/ or /etc/ssl/certs/ and use the update-ca-trust enable/extract commands is so that it can survive an update. If someone decides to patch the machine and there are other certificates being updated, the one that you appended to the bundle will get deleted.

Follow the process! For me, that’s basically:

cp <filename>.pem /etc/pki/ca-trust/source/anchors/
cp <filename>.crt /etc/pki/ca-trust/source/anchors/
update-ca-trust force-enable
update-ca-trust extra

Make your own pizza at home!

I thought about it a little bit, but not a lot. A friend of mine that used to work at a pizza place told me that your home oven is just not hot enough. That’s not exactly true. I started to do it only because a different friend of mine did it first. He made it and his pizza to me, tasted like pizza that you would get in an elementary school cafeteria. Well, I thought maybe I could do better. Since we are in a lock-down anyway, I thought I would give it a shot. I’m very glad that I did. It’s very easy and well worth it.

I watched a bunch of YouTube videos and since I have a cast iron pan and no pizza stone, I started with that. My pizza dough has about 50% hydration.

The dough recipe is as follows:
1 cup bread flour
1/2 cup water
1/4 teaspoon yeast
1 teaspoon sugar
1/4 teaspoon salt

I just take a spoon or fork or spatula or chopstick or whatever I have close by and mix it. Mix it until it comes together and you see no more water and you can either knead it or just leave it. Then you let it sit for 2 hours at room temperature or overnight in the refrigerator. If you’re in a hurry, you can proof it in the oven by turning the oven on to the lowest temperature possible (mine is 150F) and then opening the door. Leave the door open for a couple of minutes so that the temperature comes down to under 100F. Then, quickly setting it next to a cup of boiling hot water and shutting the door. (Don’t let the water touch the dough.) When the dough doubles in size, it’s ready to be stretched out and go into the pan. I’ll salt and put some Italian seasoning on the pan just prior to putting the dough into the pan because I want to get some flavor on the bottom of the pizza. If you’re lazy like me, you can just drop the ball into the pan and stretch/flatten it out there. If the dough pulls back too much, just leave it and let it sit for about 5 minutes and try again.

I don’t have any portion sizing for the sauce/toppings. All I can say is don’t put too much. From one of the YouTube videos I watched, the guy says, if it feels like it’s just short, it’s probably perfect.

I’ve used this recipe for my sauce:
8 tomatoes
5-6 basil leaves
garlic salt/pepper
a couple of garlic cloves
a little bit of Parmesan cheese

Then you can basically just cook the sauce out until it’s reduced to very little water. I might’ve put too much Parmesan – the sauce came out orange, but tasted fine. I cooked it along with the mushrooms also so that the mushrooms wouldn’t release too much water into the pizza.

In the picture, I’m using store bought Classico pizza sauce. Just take a ladle of store bought pizza sauce or the sauce you made and spoon it around the dough on the pan. When you feel like you’re just short, it’s probably enough. Don’t put too much or the dough will stay wet. If you would prefer the dough to be dry, you can put a layer of cheese down on top of the dough first. You might get a wetter pizza though. Then just lay the toppings on. I don’t buy shredded cheese, ever. I’m not a fan of the anti-caking agents that they come with and it also goes bad very quickly. I prefer to buy blocks of my own cheese and grate or slice or cut it myself. In the picture, I’ve sliced my cheese thinly and layered on top and the bottom. I mix mozzarella and parmesan. You can see raw mushrooms in the picture, but I won’t put raw mushrooms on a picture anymore. I’ll just par-cooked if not cooked because mushrooms release too much water. I would recommend cooking any vegetables prior to putting them onto the pizza just to release the water.

When you’re done topping the pizza, fire up the stove onto medium high heat and let it cook for about 5 minutes or so. Then put it into the broiler at low heat for about 5 minutes or until golden brown. I then go and check the bottom of the pizza with the spatula and adjust the heat until I see the desired color. For me, it’s golden brown.

This is what the pizza looked like before baking.
This is what the pizza looked like after baking.

Enjoy your pizza! I’d love any feedback! Questions or comments welcome.