Migrating github projects to gitlab

For the projects that have issues, wikis, and all those nice addons, use the GitLab GitHub importer tool.

For simple projects, you can just call them from the command line. See https://gitlab.com/bgstack15/former-gists/blob/master/migrate.sh.

#!/bin/sh
# https://stackoverflow.com/questions/20359936/import-an-existing-git-project-into-gitlab/30483494#30483494

username="bgstack15"
repo="${1}"

func() {
   git clone --mirror "https://github.com/${username}/${repo}" "./${repo}"
   pushd "${repo}"
   git remote add gitlab "https://gitlab.com/${username}/${repo}.git"
   git push gitlab --mirror
   popd
}

time func ;

#Now if you have a locally cloned repository that you want to keep using with the new remote, just run the following commands* there:
#
#git remote remove origin
#git remote add origin "http://gitlab.example.com/${username}/${repo}.git"
#git fetch --all
Advertisements

#movingtogitlab

#movingtogitlab

Meme about github and ms

I do not use social media, unless github, gitlab, or WordPress.com count. But, here is my hashtag for the week: #movingtogitlab.

With the disheartening news about a week ago of a malevolent force taking over the community darling github.com, I have decided to move my projects to gitlab. Plus, I was awakened to the fact that github’s value-added bits are closed source. Well, what an interesting situation! And I was just getting a few stars on some of my repositories too.

Check out the traffic of the gitlab github importer: https://monitor.gitlab.net/dashboard/db/github-importer?orgId=1.

I will be sharing over the next few posts some tools I used to facilitate this process. I had some help with the gist one, and I used a simple tool for the git repos.

Someday I may even run my own instance of gitlab.

Notes for git log

git log --graph --oneline --all
* 5240127 cladu.sh: fix the tluid=tduid check syntax
* 9a4afe3 fix comments about branch in metadata of various files
*   93893b0 Merge remote-tracking branch 'origin/master' into work1
|\  
* \   7ba8d7e Merge branch 'master' of https://gitlab.com/bgstack15/bgscripts into work1
|\ \  
* | | 476f863 add cladu and bump to 1.3-4
* | | abbb687 userinfo: add chage
* | | 3c87f21 fix work1 branch again
* | | b9caef9 update %files core in spec

Git log output

vSphere web client error

If you see this error, you probably see it every time you log in. Isn’t it frustrating?

An internal error has occurred - Unable to load resource module from /EBR2/locales/EBR-en_US.swf.

Reloading the client is recommended, so as to clear any problems left by this error.

Click Yes to reload the vSphere Web Client?

And the error stack:

Error: Unable to load resource module from /EBR2/locales/EBR-en_US.swf
	at MethodInfo-666()
	at flash.events::EventDispatcher/dispatchEvent()
	at ModuleInfoProxy/moduleEventHandler()
	at flash.events::EventDispatcher/dispatchEvent()
	at ModuleInfo/errorHandler()

The solution comes from the bowels of the Internet.

To avoid this issue, add port 9443 into the vsphere Web Client browse request, and then open the vcenter. Type the following address: https://<vcenter_ip&gt;:9443 where: vscenter_ip is the IP address of the vsphere Web Client.

References

Weblinks

http://docplayer.net/18033329-Emc-networker-vmware-integration-guide-version-8-2-sp1-and-later-302-001-580-rev-14.html

Searches

https://duckduckgo.com/?q=g!+%22%2FEBR2%2Flocales%2FEBR-en_US.swf%22&ia=web

Devuan and Dell D630 graphics issue

On one of my Dell D630s running Devuan GNU/Linux, I ran into an interesting issue. It does not occur on my other D630, so there’s hope. Originally I actually changed from my i686 installation of Devuan ascii to the x86_64 version, but the problem still persistent.

After a few minutes of dedicated searching, I found the answer!

tl;dr

Put on the kernel line:

video=SVIDEO-1:d

Normally in /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="quiet video=SVIDEO-1:d"
And then you have to run:
grub-mkconfig -o /boot/grub/grub.cfg

Explanation

The symptom of my problem occurs when changing screen resolutions in X11, or switching to or from the X11 display to a different tty. The mouse responds and moves around the (graphical) screens, but nothing else is updated for about 10 seconds.

I investigated dmesg, and it shows the very interesting results at the bottom of the post. After shortening the snippet to paste into Internet search engines, I finally found an answer! This bug has something to do with handling the svideo output. Disabling the svideo output (my Dell Latitude D630 does not even have one!) makes the issue go away.

[  168.672218] [drm:drm_atomic_helper_commit_cleanup_done [drm_kms_helper]] *ERROR* [CRTC:29:pipe B] flip_done timed out
[  168.776236] ------------[ cut here ]------------
[  168.776296] WARNING: CPU: 1 PID: 2274 at /build/linux-6WgLIg/linux-4.9.88/drivers/gpu/drm/drm_irq.c:1254 drm_wait_one_vblank+0x197/0x1a0 [drm]
[  168.776299] vblank wait timed out on crtc 1
[  168.776302] Modules linked in: appletalk ax25 ipx p8023 p8022 psnap llc bnep bluetooth rpcsec_gss_krb5 nfsv4 dns_resolver nfsd auth_rpcgss oid_registry nfs_acl nfs lockd grace fscache sunrpc parport_pc ppdev lp parport iTCO_wdt iTCO_vendor_support b43 bcma snd_hda_codec_idt snd_hda_codec_generic mac80211 snd_hda_intel snd_hda_codec cfg80211 coretemp snd_hda_core dell_wmi kvm_intel sparse_keymap dell_rbtn rng_core dell_laptop kvm snd_hwdep yenta_socket snd_pcm dell_smbios rfkill snd_timer snd dcdbas dell_smm_hwmon irqbypass soundcore lpc_ich pcmcia_rsrc i915 mfd_core joydev pcspkr evdev serio_raw drm_kms_helper shpchp battery video wmi button ac drm i2c_algo_bit acpi_cpufreq ext4 crc16 jbd2 crc32c_generic fscrypto ecb glue_helper lrw gf128mul ablk_helper cryptd aes_x86_64 mbcache dm_mod sr_mod cdrom
[  168.776470]  sg sd_mod hid_generic ata_generic usbhid hid psmouse firewire_ohci ata_piix i2c_i801 ssb i2c_smbus mmc_core pcmcia firewire_core crc_itu_t pcmcia_core libata tg3 ptp pps_core libphy scsi_mod thermal ehci_pci uhci_hcd ehci_hcd usbcore usb_common
[  168.776532] CPU: 1 PID: 2274 Comm: Xorg Tainted: G        W       4.9.0-6-amd64 #1 Debian 4.9.88-1+deb9u1
[  168.776535] Hardware name: Dell Inc. Latitude D630                   /0KU184, BIOS A08 02/28/2008
[  168.776540]  0000000000000000 ffffffff9312f774 ffffb93e40b1f980 0000000000000000
[  168.776551]  ffffffff92e78a5e ffff9dc735860000 ffffb93e40b1f9d8 0000000000000000
[  168.776559]  0000000007000df1 ffff9dc77bc8a898 ffff9dc736bf2800 ffffffff92e78adf
[  168.776568] Call Trace:
[  168.776582]  [] ? dump_stack+0x5c/0x78
[  168.776591]  [] ? __warn+0xbe/0xe0
[  168.776597]  [] ? warn_slowpath_fmt+0x5f/0x80
[  168.776604]  [] ? finish_wait+0x3c/0x70
[  168.776642]  [] ? drm_wait_one_vblank+0x197/0x1a0 [drm]
[  168.776648]  [] ? prepare_to_wait_event+0xf0/0xf0
[  168.776733]  [] ? intel_get_load_detect_pipe+0x624/0x640 [i915]
[  168.776799]  [] ? intel_tv_detect+0x15a/0x590 [i915]
[  168.776828]  [] ? drm_helper_probe_single_connector_modes+0x432/0x520 [drm_kms_helper]
[  168.776866]  [] ? drm_mode_object_get_properties+0xd7/0x100 [drm]
[  168.776904]  [] ? drm_mode_getconnector+0x32a/0x360 [drm]
[  168.776938]  [] ? drm_ioctl+0x1ed/0x470 [drm]
[  168.776975]  [] ? drm_mode_connector_property_set_ioctl+0x60/0x60 [drm]
[  168.776984]  [] ? __fpu__restore_sig+0x7b/0x580
[  168.776992]  [] ? do_vfs_ioctl+0xa2/0x620
[  168.776997]  [] ? SyS_ioctl+0x74/0x80
[  168.777004]  [] ? do_syscall_64+0x8d/0xf0
[  168.777011]  [] ? entry_SYSCALL_64_after_swapgs+0x58/0xc6
[  168.777016] ---[ end trace 8f754217765c1d43 ]---
[  168.921006] ------------[ cut here ]------------

References

Weblinks

  1. https://bugs.freedesktop.org/show_bug.cgi?id=93782

Searches

https://duckduckgo.com/?q=g!+drm_irq.c%3A1254+drm_wait_one_vblank%2B0x197%2F0x1a0&ia=web

Learn when a user was added or removed from AD domain group

Ripped shamelessly from https://learn-powershell.net/2013/05/21/find-when-a-user-was-added-or-removed-to-a-domain-group-using-powershell-and-repadmin/

I was investigating when a user was added to a group the other day, because I completely missed a member of a different team being added to my linux_admins group, which gets full sudo privileges on every GNU/Linux system in the corporate network.

repadmin /showobjmeta dc1 'CN=Domain Admins,CN=Users,DC=example,DC=com'

Notes on reacting to ssh key used to connect to server

The answers to https://unix.stackexchange.com/questions/15575/can-i-find-out-which-ssh-key-was-used-to-access-an-account provide some interesting details I’ve never seen before.

You can specify a command to run in the ~/.ssh/authorized_keys file:

command="/usr/share/bgscripts/work/react-ssh.sh ; /bin/bash" ssh-rsa AAAAB3NgaC1yc2EAAAABJQAAANEAnYh0nq5dzOgIgfkh50Th68hZoX+zR[...output truncated...]

Inside my example react-ssh.sh file:

journalctl -n30 -u sshd.service 2>/dev/null | grep -E "sshd\[$( ps --noheaders -o ppid $( ps --noheaders -o ppid $( ps --noheaders -o ppid $$ ) ) | xargs )]: Accepted publickey for ${USER}" | tail -n1 | awk '{print $(NF-1),$NF}'

So when I log in with an ssh key, it will print it out for me:

[bgstack15@example1|/home/bgstack15]$ ssh example2
RSA SHA256:I3wuJRyf1dWCzeqdLl6mWfMl9wONJLk38/xUwLCiNgA
[bgstack15@example2 ~]$

Here is a script that could be called with a parameter to show the entire public key of the hash.

#!/bin/sh
# to show the full public key of the provided hash
test -z "${SFK_AUTHORIZED_KEYS}" && SFK_AUTHORIZED_KEYS=~/.ssh/authorized_keys

SFK_HASHES="$( ssh-keygen -l -f "${SFK_AUTHORIZED_KEYS}" )"
for word in $@ ;
do
   sed -n -r -e "$( echo "${SFK_HASHES}" | grep -hn "${word}" | awk -F':' '{print $1}' )p" "${SFK_AUTHORIZED_KEYS}"
done

Add user agent overrides in Pale Moon

Pale Moon is a wonderful web browser. I use it as a daily driver. Some websites think it is outdated and will actually send a page saying, “Your browser is outdated. Please update to a modern browser to use this site.”

I disagree with their assessment. Additionally, Pale Moon has the ability to change the user agent when talking to domains. You can just make a new entry in the about:config page.

general.useragent.override.deviantart.net Mozilla/5.0 (X11; Linux x86_64; rv:3.4) Goanna/20170101 PaleMoon/27.6.1
general.useragent.override.netflix.com Mozilla/5.0 (X11; Linux x86_64; rv:45.9) Gecko/20100101 Firefox/45.9

Just make a new entry with name: general.useragent.override.domain.com. And just experiment with the user agent string to send until you get it right for the site in question.