Posts for: #Linux

SmartOS Tricks

Start smartOS VM from iso that is in /zones/UUID/root/ vmadm start UUID order=cdn,once=d cdrom=/FILE.iso,ide Set static vnc port Do vmadm list to get UUID vmadm update UUID_HERE vnc_port=PORT_#_HERE I love RealVNC. It works well and they have stand-alone executable here’s the LINK
MORE →

XCP-NG Quick Notes

I learned about XCP-NG not to log ago and love it. It’s great and easy to use. My only issue is I guess on newer versions of Windows 10/Server 2019 they were having freezing issues. I had the issue with Windows 10. I just went with Windows 7 VMs for what I needed until they get the problem worked out. XCP-NG works great with Linux. Here are some useful commands I’ve found.
MORE →

Search and replace Wordpress Database

I NO LONGER RECOMEND USING THIS WAY. I RECOMEND USING WP-CLI SEARCH-REPALCE. HOW TO USE CAN BE FOUND HERE. Below is the search and replace for WP which I find really helpful when changing to a new domain. I DO NOT TAKE ANY RESPONSIBILITY FOR USING THIS. MAKE SURE TO BACK UP YOUR DATABASE BEFORE YOU USE THIS SOFTWARE. ALSO THIS MAY NOT BE THE NEWEST VERSION SO IF YOU WANT THE NEWEST VERSION FOR SURE GO TO THE SITE.
MORE →

NextCloud with Apache behind NGINX reverse proxy on CentOS

This is probably useful to figure out how to reverse proxy Apache behind NGINX, but I was finally able to get NextCloud working on NGINX with no problem I like to use NGINX as my web server because that’s what I’ve always worked with. I’ve tried a couple times to get NGINX to work with NextCloud, but it would also end up not letting me log in. I did some Googleing and I guess it has something to do with how the cache is handled in NGINX.
MORE →

Static IP KVM Guest

Copied from Here If you don’t want to do any configuration inside the guest, then the only option is a DHCP server that hands out static IP addresses. If you use bridge mode, that will probably be some external DHCP server. Consult its manual to find out how to serve static leases. But at least in forward modes nat or route, you could use libvirt’s built-in dnsmasqd (More recent versions of libvirtd support the dnsmasq’s “dhcp-hostsfile” option).
MORE →

Add clonezilla to Fog Project

mkdir /var/www/html/fog/cz Download iSO and extract to /var/www/html/fog/cz Go to Fog Configuration > iPXE New Menu Entry Give it a menu item name Add the below to “Parameters” :Clonezilla echo Starting CloneZilla with default options kernel http://IP/fog/cz/live/vmlinuz initrd http://IP/fog/cz/live/initrd.img imgargs vmlinuz initrd=initrd.img boot=live username=user union=overlay config components quiet noswap edd=on nomodeset nodmraid locales= keyboard-layouts= ocs_live_run=“ocs-live-general” ocs_live_extra_param="" ocs_live_batch=no net.ifnames=0 nosplash noprompt fetch=http://IP/fog/cz/live/filesystem.squashfs boot || goto MENU Now it should work.
MORE →

MySQL/MariaDB Not Securing

mysql_secure_installation doesn’t seem to work on the newest Debain After some googling I think I found what works for me. Delete anon user DELETE FROM mysql.user WHERE User=’'; delete non local root user DELETE FROM mysql.user WHERE User=‘root’ AND Host NOT IN (’localhost’, ‘127.0.0.1’, ‘::1’); drop test database DROP DATABASE IF EXISTS test; drop all other root users drop user ‘root’@’localhost’; drop user ‘root’@‘127.0.0.1’; drop user ‘root’@’::1’; create a new root user with password
MORE →

Mail Server

I ended up switching to modoboa. I’ve been very happy with it on ServerCheap. I finally set up my own mail server using a couple guides. Just putting this here for my memory. Thank you to the great people who write amazing blogs. How to set up the server When put behind cloudflare you need to add the bellow to /etc/nginx/nginx.conf in the http { location # CF set real ip set_real_ip_from 103.
MORE →

Screenly

This is something I’ve really been wanting to play with. I will one day. https://www.screenly.io/ose/
MORE →

Disable SuperMicro IPMI ADMIN user

Disable ADMIN user Before doing this bit you may wish to check that the new user you added works for everything you need it to. Those things might include: ssh to [email protected] Log in on web interface at https://192.168.1.22/ Various ipmitool commands like querying power status:$ ipmitool -I lanplus -H 192.168.1.22 -U somename -a power status Password: Chassis power is on If all of that is okay then you can disable ADMIN:
MORE →

CloudFlare with nginx and plex

Add the following to the http in /etc/nginx/nginx.conf. This tells nginx where the actually IP is coming from instead of showing as cloudflare. # CF set real ip set_real_ip_from 103.21.244.0/22; set_real_ip_from 103.22.200.0/22; set_real_ip_from 103.31.4.0/22; set_real_ip_from 104.16.0.0/12; set_real_ip_from 108.162.192.0/18; set_real_ip_from 131.0.72.0/22; set_real_ip_from 141.101.64.0/18; set_real_ip_from 162.158.0.0/15; set_real_ip_from 172.64.0.0/13; set_real_ip_from 173.245.48.0/20; set_real_ip_from 188.114.96.0/20; set_real_ip_from 190.93.240.0/20; set_real_ip_from 197.234.240.0/22; set_real_ip_from 198.41.128.0/17; set_real_ip_from 2400:cb00::/32; set_real_ip_from 2606:4700::/32; set_real_ip_from 2803:f800::/32; set_real_ip_from 2405:b500::/32; set_real_ip_from 2405:8100::/32; set_real_ip_from 2c0f:f248::/32; set_real_ip_from 2a06:98c0::/29; # use any of the following two real_ip_header CF-Connecting-IP; #real_ip_header X-Forwarded-For; This is the reverse proxy file /etc/nginx/sites-available/plex.
MORE →

IPTables Fun

I found these scripts years ago and decided to use them. I might as well share them First the ipset and iptables need to be installed apt install iptables ipset Now we need to create the ipset lists ipset create drop hash:net ipset create allowHTTPS hash:net ipset create allowSSH hash:net ipset create directHTTPS hash:net ipset create google hash:net script to update files and countries. If you go to the ipdeny site you can find which countries you can add.
MORE →

Install FusionIO ioDrive2 on Debian

If using Debian 10 you’ll have to use the github VSL. I just started using it, I will update if there’s issues. HERE’S the link. Now we need to make the module be loaded. mkdir /lib/modules/4.19.0-10-amd64/kernel/drivers/iomem cd root/usr/src/iomemory-vsl-3.2.16 cp iomemory-vsl.ko /lib/modules/4.19.0-10-amd64/kernel/drivers/iomem Now we need to add it to be loaded on bootup nano /etc/modules Paste iomemory_vsl into the /etc/modules file. `` First go to LINK and download the needed items I also have a copy that I downloaded HERE.
MORE →

Install ZFS on Debian 9.5 (Stretch)

As root echo "deb http://ftp.debian.org/debian stretch main contrib" >> /etc/apt/sources.list apt update apt upgrade -y reboot Now we are going to install the linux headers for the current linux version apt install linux-headers-$(uname -r) Now we are going to install zfs itself. This is going to take a while apt install zfs-dkms
MORE →

How to enable vlans on Debian 9

I just did this on Debian 9, it might work on older versions and more than likely Ubuntu Do everything as root: sudo su - Install vlan package: apt-get install vlan Load 8021q module: modprobe 8021q Add 8021q module at bootup: echo 8021q | sudo tee -a /etc/modules Make sure it is in the file: cat /etc/modules Now we need to edit the interfaces file: nano /etc/network/interfaces There will probably be something like below
MORE →

UEFI CloneZilla

When cloning using clonezilla I notice sometimes if the PC was using UEFI it wouldn’t clone. After some googleing I was able to find a post that mentioned you had to manually copy over the bootloader. It is very simple to do. Once booted into CloneZilla you enter shell instead of the normal start. Once in the shell you’re going to become root. sudo su. Once you’re root you going to type the following command.
MORE →

How to use SSH keys

create public and private keys. You can just hit enter or change the options. ssh-keygen -t rsa Now we need to copy our public key to the servers authorized keys cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys" Now once you’ve completed teh above you should just be able to ssh to the remote host. If you want to be able to ssh as root.
MORE →

Add Linux Mint to Active Diretory

First we are going to become root sudo su Next we are going to join the realm. This should installed everything needed after you run the command below realm join domain.com --user domainadmin Permit all users to log in. realm permit --all Add user group as root nano /etc/sudoers Paste into above file %groupname@domain ALL=(ALL:ALL) ALL Allow sssd to create user directory nano /etc/pam.d/common-session Paste into above file session optional pam_mkhomedir.
MORE →

Install php7, nginx, mariadb centos 7

I am not a pro, this is just what I’ve learned over the years and noticed that a bunch of tutorials didn’t have all the info I needed/used so I figured I’d make my own. rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm yum update yum install -y nginx mariadb-server mariadb git yum --enablerepo=remi-php72 install php-fpm php-common php-opcache php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongodb php-pecl-redis php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-zip php-gmp Next we are going to want to enable everything to run on start up systemctl enable php-fpm systemctl enable nginx systemctl enable mariadb systemctl start mariadb
MORE →

Comments: