Posts

Remotely connect to Windows 11 PC using a "passwordless" account

Remotely connecting to a Windows PC with a Microsoft "passwordless" is possible and I finally found a simple workaround at https://cmdrkeene.com/remote-desktop-with-microsoft-account-sign-in/ Copying it here is it does not get lost: On the PC hosting the remote desktop session (running Windows Pro or better), run the following command, replacing the example email address with your Microsoft Account email address that you use to login to the computer. runas /u:MicrosoftAccount\username@example.com winver This command runs the “winver” program under the credentials of the user account specified. It sounds (and is) pretty simple, but what it does in the background is caches your Microsoft Account credentials. Since your local user account had no password, it wasn’t eligible for RDP use even if it has appropriate permissions otherwise. After supplying the password and pressing Enter, you’ll know it worked if you see the About Windows dialog box open. Go ahead and close it and the...

Running a serial login terminal under systemd

TL;DR: $ sudo systemctl edit serial-getty@ttyUSB0 [Service] ExecStart= ExecStart=-/sbin/agetty -o '-p -- \\u' 115200 %I $TERM StandardInput=null StandardOutput=journal TTYPath= TTYReset=no TTYVHangup=no From the other node: $ tio /dev/ttyUSB0 I have a MINI PC  in the comm area which hosts a few useful services at home. I got tired of how unstable the Raspberry Pi is, so replaced it with something that is almost as power efficient, but runs orders of magnitude faster. With support for both an SSD and an NVMe I can have software RAID for extra reliability. The problem is that the onboard network (something based on RTL8111) insists on running at 100M and keeps flapping up and down. Got tired of troubleshooting it so got a USB network adapter  which runs at 1G and is much more stable. Recently I noticed that the link would die, and as I have no way of getting into the machine easily to troubleshoot, I decided to give it a serial console. Got a male USB to serial converter , and ...
Removing replica (FreeIPA in containers) Running FreeIPA in containers, and a few notes on the replicas: replica=replica.domain sudo podman exec -it ipa-replica-manage del $replica sudo podman exec -it ipa-csreplica-manager del $replica sudo podman exec -it freeipa pki securitydomain-show sudo podman exec -it freeipa pki -d /etc/pki/pki-tomcat/alias/ -n 'subsystemCert cert-pki-ca' -C /etc/pki/pki-tomcat/alias/pwdfile.txt securitydomain-host-del "CA $replica 443"

FreeIPA cluster with containers

Notes on how to install a FreeIPA cluster on Ubuntu. Mostly following the instructions on https://github.com/freeipa/freeipa-container Start with what would be the primary host. If you install a third replica you would want to review the replica agreements to ensure you have a two-way replication between all pairs of nodes.

Installing Gentoo with full disk encryption

The purpose of this exercise - install Gentoo where all disk partitions are encrypted. Boot from a system rescue disk and partition the disk - use GPT partition table where the first partition is reserved, second is the boot, and the third one is for the rest of the data. Device Start End Sectors Size Type /dev/sda1 2048 32767 30720 15M BIOS boot /dev/sda2 32768 442367 409600 200M Linux filesystem /dev/sda3 442368 375093902 374651535 178.7G Linux filesystem Encrypt partitions number 2 and 3, and open them cryptsetup luksFormat /dev/sda2 cryptsetup luksFormat /dev/sda3 cryptsetup luksOpen /dev/sda2 crypt_boot cryptsetup luksOpen /dev/sda3 crypt_data Format the boot partition mkfs.btrfs /dev/mapper/crypt_boot Prepare LVM for the rest, and format the top level vgcreate vg0 /dev/mapper/crypt_data lvcreate -l 100%FREE -n data vg0 mkfs.btrfs /dev/vg0/data Mount and set up any subvolumes mount /dev/vg0/data /mnt/gentoo btrfs subvol create /mnt/gentoo/@ /mnt/gentoo/@home umount /mnt/gentoo Now...

The Short Introduction to TLS Certificates

Why do we need TLS? If you have to ask this question, then you probably do not need TLS at all. TLS is a technology that allows for authenticated and/or encrypted communication. However, I am not going to explain in details what TLS is. If this is the question whose answer you're seeking, then you have better try a search on Google . This HOWTO is aiming at guiding you through the basic steps in creating your own TLS certificates for your own servers. This means that I am assuming that you know enough about *nix like operating systems, and that you also have an idea what TLS certificates are used for. Create the certificate The process of creating an SSL certificates usually goes like this: Create a private key Create a certificate request Send the certificate request to your CA Receive the certificate from your CA Now, we'll cover each step on the way. Create the private key First we need to generate your key. It is also possible to generate it on the fly in the next step, but...

Getting rid of the /lib symlink on Gentoo

The /lib and /usr/lib symlink on Gentoo I find quite annoying. These just let software make assumptions about whether they should use /usr/lib or /usr/lib64 , and I personally prefer if things break so they can be fixed. I wanted to follow what RedHat (and Fedora) are doing, which is, 32-bit stuff goes in lib and 64-bit in lib64 . Luckily, Gentoo was also headed this way. So, here is what I did. First I prepare a custom profile. This profile inherits these two: default/linux/amd64/13.0/desktop/gnome/systemd , which I normally use features/multilib In the custom profile I add make.defaults with the single line SYMLINK_LIB="no" . Get rid of the lib symlink, but do it carefully. First copy everything from lib64 to lib (well, I just opted for hard linking everything): sudo rsync -avPAH --link-dest /lib64/{,} /lib.new/ sudo rsync -avPAH --link-dest /usr/lib64/{,} /usr/lib.new/ sudo bash -x -c 'rm -v /lib && mv /lib.new /lib' sudo bash -x -c 'rm -v /usr/...

Rooting the Galaxy S4 (DoCoMo model

I dropped my S4 and the screen broke quite badly. I got a replacement (insurance finally paid off!) and that one of course came with the latest firmware. I have heard that rooting this one may not be so easy, but it turned out to be even easier than the experience I had before. I should note, that I don't care about rooting the stock ROM. I am cooking my own CyanogenMod, hence, all I need is to be able to flash my own ROM. And that is so much easier. In one sentence, all I had to do is flash a custom recovery onto my phone, and then I could do whatever I want, including flash a custom ROM, or restore the nandroid backup from the identical broken phone. On Linux, I only needed to install heimdall (the packages is available on Gentoo).

Installing Horde 4

I love my horde installation. Recently I tried upgrading to horde version 4 and here are the few gotchas that I encountered on the way. The sane thing to do is, follow the installation guide . Until now I was always installing Horde from the Gentoo packages. The installation is straightforward, and occasionally I had to bump the version in a local overlay myself. Starting with version 4, Horde now supports installation directly from PEAR , or from git . My first instinct was to install it from git. It should be easy to get the latest version and it is also easy to dig into the code if you have it in a git repository. Unfortunately Horde is an application with multiple components and the development of all is happening concurrently in the same repository . In other words, you always get the latest version, even if you only want the stable versions of the separate components. Installing from PEAR And so I settled for a PEAR installation. I made a "horde-pear" directory outsid...

Upside down characters?

I just saw that Facebook are offering a "translation" in English - Upside Down . My first thought was "who would ever design such glyphs?". Then, after looking at the characters I realized that they are not really turned around, just close enough. For example, a lower case U for an upside-down lower-case N . abcdefghijklmnopqrstuvwxyz ɐqɔpəɟᵷɥıɾʞlɯuodbɹsʇnʌʍxʎz

Building Gentoo for Sheevaplug

First of all, I got an IDE <-> USB converter and plugged a spare PATA 80G disk in my plug. Boot the plug and install Gentoo on the SheevaPlug as you normally would. You can even boot from the USB disk (don't forget to add rootwait to the kernel parameters or it will almost surely complain that /dev/sda1 is not there yet). When you have the system the way you like it, I made two directories - /mnt/root-src and /root/root-dst then I did the following (you may want to make it a script): mount -o bind / /mnt/root-src rsync -avPH /mnt/root-src/ /mnt/root-dst/ --delete --delete-excluded \ --exclude-from <( q list -o -s gcc portage paludis app-admin/\* app-portage/\* docbooc man cat <<-'EOF' /.git* *.a *.h /mnt /var/repos /var/cache /usr/share/info /usr/share/man /usr/share/doc /usr/share/locale /usr/share/aclocal* /usr/share/automake* /usr/share/autoconf* /usr/lib/debug /usr/lib/pkgconfig ...

Looking for a personal finance software

I have been looking for alternatives to Microsoft Money for a while. While annoying to have to keep a virtual Windows machine just for Money (which you can freely download from Microsoft by the way), it was working just great. The features I really liked about it are: Keyboard shortcuts made it very easy to quickly enter multiple entries Importing my monthly credit card statement made it very easy to reconcile and catch any potential errors Easy to get monthly reports about my spending But then one day the latest import made Money crash and I was forced to look for alternatives. Gnucash Pros: easy to match imported transactions to already existing transactions has android app that is easy to import from sufficient support for multiple currencies Cons: clumsy interface reports are almost unusable OFX support is buggy crashes on legitimate OFX files imported categories from the mobile app create duplicate transactions Skrooge Pros: very nice interface automatic download of the latest exc...

ADSL Router Model CT-5367 user and pass (VIVACOM)

Writing down the username and password for the vivacom ADSL router, in case I need it again. user: root pass: warmWLspot Useful to telnet 192.168.1.1 and then reboot . Originally found at Neo2SHYAlien blog . And here I found passwords for other models, just in case. ZTE ZXDSL 832 username: root password: GSrootaccess ZTE ZXDSL 831 username: root password: GSrootaccess ZTE username: root password: 831access Huawei SmartAX MT882 username: root password: MT882rootaccess ZTE ZXDSL-531b username: root password: rootWLaccess Pirelli – DRG – A124G username: root password: warmWLspot Comtrend CT-5367 username: root password: warmWLspot HG530 Home Gateway username: root password: warmWLspot

CyanogenMod 10.2 on Samsung Galaxy S4 (Japanese DoCoMo version - jfltedcm)

Here is how I managed to get CyanogenMod on my Galaxy S4 - the Japanse DoCoMo model. Starting back to front, the short version is: Get the repo command, and get ready to compile CyanogenMod as usual repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2 Prep the extra repositories needed to compile the Samsung phone model. $ cat .repo/local_manifests/s4.xml <?xml version="1.0" encoding="UTF-8"?> <manifest> <project path="device/samsung/jf-common" name="kbc-developers/android_device_samsung_jf-common" /> <project path="device/samsung/jfltedcm" name="kbc-developers/android_device_samsung_jfltedcm" /> <project path="device/samsung/msm8960-common" name="CyanogenMod/android_device_samsung_msm8960-common" /> <project path="device/samsung/qcom-common" name="CyanogenMod/android_device_samsung_qcom-common" /> <proje...

Udev unable to rename network interfaces

I struggled for a week having udev (on CentOS 6.3) do all kinds of silly things with the interfaces names on a server with 4 onboard 1G interfaces, an 2 dual port Mellanox ConnectX-3 cards. The short story is that udev was trying to preserve the names of the interfaces to be consistently numbered starting from eth0 and ending with eth7. The problem: the modules for the network cards do not always get probed/loaded in the same order. Udev does the module loading automatically and considering how heavily parallel it is, if the Mellanox driver gets loaded first and the onboard tg3 driver second, udev tries to swap eth eth0-eth3 interfaces with eth4-eth7. Most of the time this leaves a huge mess behind. I followed RedHat's advice to stop using the "eth" names but even then udev failed to rename one or two of the eth interfaces most of the time. Here comes the solution. Modify the 70-persistent-net.rules that udev generates, and add an extra rule for each matching interface w...

Changing the "system" font in Windows

Especially in a Japanese windows, after changing the system language from Japanese to Bulgarian (or any other Cyrillic language), the letters used for some system dialogs would be displayed in full width font making it at times almost unreadable. There is no obvious place to change those fonts, and the only help is in the registry itself. Navigate to this key in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes And change the values for MS Shell Dlg and MS Shell Dlg 2 to a non-Japanese font (the default MS Sans Serif and Tahoma are actually pretty good). You can also try Arial Unicode MS if you still care about Japanese characters. There is a more detailed explanation at this page .

Deciding on a photo hosting service

I am getting way too lazy for my own good. After my latest trip I now want to share my photos with friends and family, and I am trying to decide how to easily to this. And since I couldn't really decide on what I need, I decide to list (mostly for myself) what I am looking for in a photo sharing service. ability to upload original images, so people can download and print photos at decent quality (12M resolution to be allowed) decent space available - my average photo size is 5MB organize photos in albums, many albums privacy - I certainly do not want to make all my photos visible to the whole world ability to share with non-account holders - I want to be able to send an email with a link to the album and not impose on my relatives to have to sign up for yet another service they may or may not need I will be trying out the two big players - Picasa and Flickr in the coming days and update this post with my findings.

Lame web interface on Motorola SBG900

Image
I've been struggling with a wireless SBG900 for a couple of hours now. The interface looks fine (as far as wireless router interfaces go) and I had the simple setting up WPA security on this router. The higher security setting was supposed to replace the current no password + MAC restriction setup. The bottom line is that after removing the registered MAC addresses the router simply refused connections from all clients. And the best part is that nowhere in the interface I could find a clicky button to enable it. [caption id="attachment_145" align="aligncenter" width="595" caption="There is no place to disable the MAC filter"] [/caption] Tamper Data to the rescue. Click "Apply" and just change the value of the Wireless.EnableAllowAccess.enableAllowAccess parameter to 0. Works fine now.

Consistent software RAID disk errors on nVidia MCP51

My brand new pair of disks in a setup that would otherwise work perfectly fine, decided to keep giving me headache. There are only two disks in the machine, partitioned in three, with the first two pairs of partitions in a RAID1 array. And every now and then one of the disks would disappear from the system, then re-appear with a different drive letter (e.g. sda would become sdc). Obviously the disk would get kicked out of the RAID, but I can then add it back and wait for the 1.5TB partition to sync back the RAID. The errors look like this: Oct 29 03:44:59 lion kernel: ata1.00: n_sectors mismatch 3907029168 != 268435455 Oct 29 03:44:59 lion kernel: ata1.00: revalidation failed (errno=-19) Oct 29 03:44:59 lion kernel: ata1.00: limiting speed to UDMA/133:PIO2 Oct 29 03:44:59 lion kernel: ata1: hard resetting link Oct 29 03:44:59 lion kernel: ata1: nv: skipping hardreset on occupied port Oct 29 03:45:00 lion kernel: ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Oct 29 03:45:00 lio...

Recovering from a failed LVM2 pvmove

After I left a loop moving the data from my LVM2 LVs to a new raid1 array overnight (I wanted to also reorder the LVs physically at the beginning of the disk) I came back in the morning to see that one of the moves had hung. I killed it, and the loop kept going. Unfortunately something had already gone wrong and I had to issue pvmove --abort to get things in order. And that almost worked, except I started getting these: > sudo lvs --all Number of segments in active LV pvmove0 does not match metadata Number of segments in active LV pvmove0 does not match metadata LV VG Attr LSize Origin Snap% Move Log Copy% Convert  download lionvg -wi-ao 200.00g home lionvg -wi-ao 100.00g kvmpool lionvg -wi-ao 50.00g opt lionvg -wi-ao 15.00g [pvmove0] lionvg p-C-a- 0 repos lionvg -wi-ao 2.00g root lionvg -wi-ao 4.00g  usr lionvg -wi-ao 20.00g var lionvg -wi-ao 20.00g I was furthermore unable to destroy or make inac...