Categories
Unix

KDE Screen Edge Gestures

I’ve been working on a new Fedora32 install these past few weeks for my personal desktop, and so far it has been great! Faster, more memory, nicer dual monitors and 20 virtual desktops!

But it seems whenever I do a yum/dnf update to get a new kernel and keep packages updated, SOMETHING always goes amiss! That latest mystery was my KDE Desktop effects stopped working, specifically the one where you move your mouse to the upper-left corner and you get to see every window across all the desktops. Since I literally will have 100 windows total across all my virtual desktops, this feature has been pretty helpful!

My clue was in /var/log/messages, “kwin_core: Compositing is not possible”

The solution is to edit ~/.config/kwinrc and update this variable to be “false”:

[Compositing]
OpenGLIsUnsafe=false

And that did the trick for me, hope this helps.

Categories
Unix

Prevent GPG Popups

So I just installed a fresh install of Fedora 32 w/ KDE and when I go to decrypt a GPG (PGP) file from a shell window, a GUI popup asks for the password. Now in the past, this would be inline so I would get the prompt in the shell.

But now with the popup, my mouse pointer would almost be never near it, and since I had strict focus under mouse, I would constantly have to move my mouse to the popup window!

Anyway, I found a number of ways to fix this out there, but here are the steps that worked for me:

Edit ~/.gnupg/gpg-agent.conf and add:

pinentry-program /usr/bin/pinentry-curses

And then add this to your environment variables (i.e., .bashrc, .profile, etc):

PINENTRY_USER_DATA “USE_CURSES=1”

And then you can restart the gpg agent via:

pkill -HUP gpg-agent

Categories
Websites Windows

Windows Media Keyboard Keys Not Working

I have a windows box I use for certain things, and on it I have a music player that plays from my local library and I use the keyboard play/pause/next/prev buttons to control it.

But recently I found these keyboard buttons were refusing to work! After much diagnoses it turns out that Chrome was over-riding the functions, Now this is actually helpful if you are using Google Music or other music players in the browser. But if you want to disable that so your other player takes control you need to go to: chrome://flags/

And search for “hardware media” and disable that! Hopefully that helps someone from music player frustration syndrome.

Categories
Websites

Google Chrome Show Full URL

One of Chrome’s recent updates hides the protocol name (HTTP/HTTPS) and the WWW prefix from the URL when the address bar is not focused.This can be confusing if you trying to test different http/https setups and need to see the designation in the URL bar.

To fix that you can visit chrome://flags/#omnibox-ui-hide-steady-state-url-scheme-and-subdomains

And do a search on “ui hide” — I personally disabled all 3 of the options that showed up, but you can pick and choose to your liking.

Categories
Coding Unix

Stopping vim8 from auto inserting on paste

After updating my linux system I found that when I went to do a mouse-paste in VIM that instead of just interpreting the characters, it went right into insert mode. This is a problem when I want to paste in a bunch of vim commands, which can be helpful if you need to re-do a series of actions multiple times.

It turns out the fix has to do with “xterm-bracketed-paste” and I had to put this in the .vimrc:

set t_BE=

I hope this helps someone who got surprised by vim version 8 functionality!

 

Categories
Coding

Having trouble accessing your Alexa skill

We have done a number of Alexa skills for clients and recently one of them would give this message to users: “Sorry, I’m having trouble accessing your {} skill right now”

Not much to go on! It turns out the problem was the content that was getting delivered for Alexa to say had some non-ASCII characters in it. The skill has dynamic content the client would update, and apparently they pasted from a Word doc which then translated a quote character into one of those annoying double wide Word characters which Alexa does not like!

So basically run your content through an ASCII-only parse before delivering it and you’re good.

Categories
Windows

Google Chrome changed background colors

I updated Chrome to version 68.0.3440.75 (Official Build) (64-bit) just the other day and found that my browser windows had the background color change from white to a washed out looking pink. At first I thought it was a monitor issue, but other browsers and applications looked fine.

I tried a few things to fix it, including changed chrome settings by going to “chrome://flags/#windows10-custom-titlebar” and trying that setting with both disabled/enabled.

Turns out what fixed it was to disable hardware acceleration! Not sure why the new version of Chrome handles that differently, the setting was the same on the older version. But in any case, to turn it off, go to “settings”, scroll to the bottom and click “Advanced”, then towards the end under “System” you can turn off hardware acceleration.

Categories
Coding Websites

Applying callback to grecaptcha

We were having some troubles with some users rushing to click the submit button on a form immediately after clicking the good ‘ole “I’m not a robot” checkbox, instead of waiting nicely for the captcha to verify. By the way, that is TOTALLY what a robot would do, so it’s probably good that it fails the verification.

But to get the submit button to only enable after the checkbox turns green, you need to provide a “callback” routine for the grecaptcha. And, you can also provide a “expired-callback” routine for if the captcha box sits around too long after a check and then turns red. Note that you need to put the defined callbacks without quotes.

Also to add some complexity, we had two separate captchas in our page, so we had to define two of them. Some people have reported troubles doing so, but our final solution worked.

We had a problem where the callback routines were not being called, but everything else was working — it turns out we have the callback functions defined AFTER the render, and moving them before that section made everything work. So, the final layout:

<script src=”https://www.google.com/recaptcha/api.js?onload=myCaptInit&render=explicit” async defer></script>
<script>
var myCaptInit = function() {
var buton11 = function() {
$(“#mainsubmit”).removeAttr(“disabled”);
};
var butoff11 = function() {
$(“#mainsubmit”).attr(“disabled”, “disabled”);
};
grecaptcha.render(‘recaptcha11’, {
‘sitekey’: ‘xxxx’,
‘callback’: buton11,
‘expired-callback’: butoff11,
‘size’: ‘compact’
});
grecaptcha.render(‘recaptcha10’, {
‘sitekey’ : ‘xxxx’,
‘size’ : ‘compact’
});
};
</script>

Categories
Hardware Unix

Recovery LVM Data from RAID

We had a client that had an OLD fileserver box, a Thecus N4100PRO. It was completely dust-ridden and the power supply had burned out.

Since these drives were in a RAID configuration, you could not hook any one of them up to a windows box, or a linux box to see the data. You have to hook them all up to a box and reassemble the RAID.

We took out the drives (3 of them) and then used an external SATA to USB box to connect them to a Linux server running CentOS. You can use parted to see what drives are now being seen by your linux system:

parted -l | grep ‘raid\|sd’

Then using that output, we assembled the drives into a software array:

mdadm -A /dev/md0 /dev/sdb2 /dev/sdc2 /dev/sdd2

If we tried to only use two of those drives, it would give an error, since these were all in a linear RAID in the Thecus box.

If the last command went well, you can see the built array like so:

root% cat /proc/mdstat
Personalities : [linear]
md0 : active linear sdd2[0] sdb2[2] sdc2[1]
1459012480 blocks super 1.0 128k rounding

Note the personality shows the RAID type, in our case it was linear, which is probably the worst RAID since if any one drive fails, your data is lost. So good thing these drives outlasted the power supply! Now we find the physical volume:

pvdisplay /dev/md0

Gives us:

— Physical volume —
PV Name /dev/md0
VG Name vg0
PV Size 1.36 TB / not usable 704.00 KB
Allocatable yes
PE Size (KByte) 2048
Total PE 712408
Free PE 236760
Allocated PE 475648
PV UUID iqwRGX-zJ23-LX7q-hIZR-hO2y-oyZE-tD38A3

Then we find the logical volume:

lvdisplay /dev/vg0

Gives us:

— Logical volume —
LV Name /dev/vg0/syslv
VG Name vg0
LV UUID UtrwkM-z0lw-6fb3-TlW4-IpkT-YcdN-NY1orZ
LV Write Access read/write
LV Status NOT available
LV Size 1.00 GB
Current LE 512
Segments 1
Allocation inherit
Read ahead sectors 16384

— Logical volume —
LV Name /dev/vg0/lv0
VG Name vg0
LV UUID 0qsIdY-i2cA-SAHs-O1qt-FFSr-VuWO-xuh41q
LV Write Access read/write
LV Status NOT available
LV Size 928.00 GB
Current LE 475136
Segments 1
Allocation inherit
Read ahead sectors 16384

We want to focus on the lv0 volume. You cannot mount yet, until you are able to lvscan them.

lvscan

Show us things are inactive currently:

inactive ‘/dev/vg0/syslv’ [1.00 GB] inherit
inactive ‘/dev/vg0/lv0’ [928.00 GB] inherit

So we set them active with:

vgchange vg0 -a y

And doing lvscan again shows:

ACTIVE ‘/dev/vg0/syslv’ [1.00 GB] inherit
ACTIVE ‘/dev/vg0/lv0’ [928.00 GB] inherit

Now we can mount with:

mount /dev/vg0/lv0 /mnt

And viola! We have our data up and accessable in /mnt to recover! Of course your setup is most likely going to look different from what I have shown you above, but hopefully this gives some helpful information for you to recover your own data.

Categories
Coding Unix

SFTP in Perl Connecting to Legacy Server

We had a client that had a need to do automated SFTPs to various sites. It turns out that some of the sites had an older SSHD that would generate an error like “DH Group Exchange reply out of range”, and that required this parameter if you were using SFTP from the command line:

-oKexAlgorithms=diffie-hellman-group1-sha1

Now in Perl we were using Net::SFTP and it took some finagling (yes, that’s really a word) to figure out the proper settings, so here they were in case you were having trouble. And we had to add the warn flag otherwise we would get this warning:

Couldn’t fsetstat: Permission denied

Another oddity was that when we were putting files, the SFTP server allowed multiple files with the same name! Very odd, so we had to make sure to add a $sftp->do_remove command prior to the put command.

Here is what we used for the function call:

%sftp_args =
( “user” => “myuser”,
“password” => “mypass”,
“debug” => 0,
“warn” => 0,
“ssh_args” => [ options => [ “KexAlgorithms diffie-hellman-group1-sha1” ] ]
);

$sftp = Net::SFTP->new($sftp_host,%sftp_args);