karlo

Update RHEL/CentOS from local repo (iso/cd)

 Uncategorized  Comments Off on Update RHEL/CentOS from local repo (iso/cd)
Jul 232020
 
sudo -i
mount -o loop /tmp/*77*.iso /mnt
cat > /etc/yum.repos.d/cd.repo
[cd]
name=cd
baseurl=file:///mnt/
enabled=1
gpgcheck=0

#[PRESS enter and CTRL-d]
yum clean all; rm -rf rm -rf /var/cache/yum;  yum makecache fast
yum -y update --skip-broken
yum update
yum erase *devel
yum update kernel redhat-release
umount /mnt
rm -i /etc/yum.repos.d/cd.repo /tmp/*iso
cat /etc/redhat-release
reboot

 Posted by at 07:12

Pihole CORS problems

 Uncategorized  Comments Off on Pihole CORS problems
Jul 192020
 

Fix:

edit

/var/www/html/admin/scripts/pi-hole/php/auth.php

add your host names to

AUTHORIZED_HOSTNAMES

array

 Posted by at 16:27

Move cygwin to different disk, including services

 Uncategorized  Comments Off on Move cygwin to different disk, including services
Jul 142020
 
  1. Stop all services, log out other users, in process explorer, add command line column, stop all in old path
  2. In cygwin, go to /cygdrive, cp -vR c/cygwin* d/
  3. mount -m > /usr/bin/mountCommands.bat # not sure if we really need this
  4. in explorer, rename c:/cygwin to OLD , log off all users if it fails, use lsof alternative if needed
  5. change shortcut on desktop (C:\Users\Public\Desktop)
  6. change start menu items [ "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cygwin\Cygwin64 Terminal.lnk"]
  7. change NEWLOC/cygwin.bat
  8. Regedit to HLM\system\CurrentControlSet\services\sshd and \cron and \syslog-ng change paths (for all services, do cygrunsrv -L)
  9. cygrunsrv --stop sshd; cygrunsrv --remove sshd; cygrunsrv --install sshd --path /usr/sbin/sshd
  10. Some more magic..?
  11. reboot
 Posted by at 12:25

ubnt / ubiquiti edgerouter passwordless login ssh keys

 Uncategorized  Comments Off on ubnt / ubiquiti edgerouter passwordless login ssh keys
Jul 052020
 
ubnt@er4gw:~$ configure
[edit]
ubnt@er4gw# set system login user ubnt authentication public-keys lb7 type ssh-rsa
[edit]
ubnt@er4gw# set system login user ubnt authentication public-keys lb7 key AAAA****3tfv0vaEUl
ubnt@er4gw# commit
ubnt@er4gw# exit
Warning: configuration changes have not been saved.
ubnt@er4gw:~$ cd .ssh
ubnt@er4gw:~/.ssh$ cat au*
# Automatically generated by Vyatta configuration
# Do not edit, all changes will be lost
ssh-rsa AAAA****3tfv0vaEUl lb7
ubnt@er4gw:~/.ssh$ configure
[edit]
ubnt@er4gw# save
 Posted by at 14:52

Bash remove spaces from file names

 Uncategorized  Comments Off on Bash remove spaces from file names
Jun 042020
 
find . -depth -name '* *' \
| while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' _)" ; done
 Posted by at 09:20

Outlook unblock “unsafe” attachments

 Uncategorized  Comments Off on Outlook unblock “unsafe” attachments
May 152020
 
Regedit, find:

Outlook 2007
[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security]
Outlook 2010
[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Security]
Outlook 2013
[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Security]
Outlook 2016, Outlook 2019 and Office 365
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Security]

Level1Remove string
Value .cer;.exe;.xxx for the stuff you want to unblock.
 Posted by at 07:18

Extend a LVM-based swap partition

 Uncategorized  Comments Off on Extend a LVM-based swap partition
Apr 172020
 

Sometimes your swap is not large enough

[root@server ~]# free -g
total used free shared buff/cache available
Mem: 23 3 13 0 7 19
Swap: 1 0 1
[root@server ~]# grep swap /etc/fstab
/dev/mapper/vg00-swapvol swap swap defaults 0 0
[root@server ~]# swapoff /dev/mapper/vg00-swapvol
[root@server ~]# lvextend -L10g $_
Size of logical volume vg00/swapvol changed from 2.00 GiB (16 extents) to 10.00 GiB (80 extents).
Logical volume vg00/swapvol successfully resized.
[root@server ~]# mkswap $_
mkswap: /dev/mapper/vg00-swapvol: warning: wiping old swap signature.
Setting up swapspace version 1, size = 10485756 KiB
no label, UUID=xxx
[root@server ~]# swapon $_
[root@server ~]# free -g
total used free shared buff/cache available
Mem: 23 3 13 0 7 19
Swap: 9 0 9
 Posted by at 08:42

Tmux save all output (history) to file

 Uncategorized  Comments Off on Tmux save all output (history) to file
Feb 042020
 
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'

Add above in tmux.conf. Then do Prefix+Shift+P

 Posted by at 20:31

Excel return last line of multi line cell

 Uncategorized  Comments Off on Excel return last line of multi line cell
Jan 272020
 

=TRIM(RIGHT(SUBSTITUTE(B5,CHAR(10),REPT(” “;200));200))

Especially useful for project trackers. Add a LEFT(XXX;10) for returning dates.

 Posted by at 08:44

Keeping a (GitHub) fork up to date with upstream master

 Uncategorized  Comments Off on Keeping a (GitHub) fork up to date with upstream master
Jan 262020
 

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream

3. Updating your fork from original repo to keep up with their changes:

git pull upstream master

thanks

 Posted by at 09:40

MySQL / MariaDB DB and user creation

 Uncategorized  Comments Off on MySQL / MariaDB DB and user creation
Jan 122020
 

create user ‘nextcloud’@’localhost’ identified by ‘xxx’;

create database nextcloud;

grant all privileges on nextcloud.* to ‘nextcloud’@’localhost’ identified by ‘xxx’;

FLUSH PRIVILEGES;

 Posted by at 20:25

AutoRecon over proxychains

 Uncategorized  Comments Off on AutoRecon over proxychains
Jan 052020
 

Since we have no icmp/ping over proxychains, we have to change syntax a bit

~/svn/proxychains-ng/proxychains4 -f ~/proxychains.conf ~/svn/AutoRecon/autorecon.py –nmap ‘\-sT \-Pn’ 10.1.1.{1,224,235,246,248}

 Posted by at 11:38

GNOME add minimize maximize

 Uncategorized  Comments Off on GNOME add minimize maximize
Dec 202019
 

I think I had a blog like this before. Apparently not. Adding minimize and maximize buttons to gnome (in kali for example, if you cannot update:)

gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'

 Posted by at 18:12

Problem building Virtualbox modules on Centos (cannot generate ORC metadata)

 Uncategorized  Comments Off on Problem building Virtualbox modules on Centos (cannot generate ORC metadata)
Nov 282019
 
Guest Additions 6.0.14 module for kernel 4.18.0-80.11.2.el8_0.x86_64.
Error building the module.  Build output follows.
make V=1 CONFIG_MODULE_SIG= -C /lib/modules/4.18.0-80.11.2.el8_0.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j2 modules
make[1]: warning: -jN forced in submake: disabling jobserver mode.
Makefile:958: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop.
make: *** [/tmp/vbox.0/Makefile-footer.gmk:111: vboxguest] Error 2
Building the main Guest Additions 6.0.14 module for kernel 4.18.0-80.7.1.el8_0.x86_64.thmtrader/status/1199833524699877376

Solution:

yum install elfutils-libelf-devel elfutils-devel

Then rebuild

 Posted by at 08:27