====== OpenSuse ======
------------------------------------------------------------------------------------------------------------------------------------------------\\
====== Configuring firewall ports ======
**Command line open ports in firewall**
sudo firewall-cmd --zone=public --add-port=5000/tcp
https://forums.opensuse.org/showthread.php/533831-Opening-ports-in-the-new-YaST2-Firewall
**Use Yast to configure open ports in firewall or turn firewall off**
* what ports are open using vsftpd
* firewall-cmd --permanent --service=vsftpd --get-ports
* 21/tcp 30000-30100/tcp
* what ports are open using Samba
* firewall-cmd --permanent --service=samba --get-ports
* 137/udp 138/udp 139/tcp 445/tcp
* Reference: man firewall-cmd
====== Hyper-v Video Resolution ======
2021-01-23
Works on grub
Set resolution
Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT (line is highlight on image) and add video=hyperv_fb:[the resolution you need]
ex:- video=hyperv_fb:1200×700
you may need to change the above value several time to achieve better screen size. 1200×700 is the value which is worked on my 1366×768 resolution windows server.
[[https://www.tectut.com/wp-content/uploads/2015/02/1.png]]
[[https://www.tectut.com/2015/02/changing-linux-screen-resolution-in-hyper-v-virtual-machine/]]
====== Hyper-V Synthetic Video Frame Buffer Driver ======
This is the driver for the Hyper-V Synthetic Video, which supports
* screen resolution up to Full HD 1920x1080 with 32 bit color on Windows
* Server 2012, and 1600x1200 with 16 bit color on Windows Server 2008 R2
* or earlier.
[[https://github.com/torvalds/linux/blob/master/drivers/video/fbdev/hyperv_fb.c]]
====== Configures video settings for virtual machines PowerShell ======
Set-VMVideo
Module:
Hyper-V
Configures video settings for virtual machines.
Syntax
PowerShell
Set-VMVideo
[-CimSession ]
[-ComputerName ]
[-Credential ]
[-VMName]
[[-ResolutionType] ]
[[-HorizontalResolution] ]
[[-VerticalResolution] ]
[-Passthru]
[-WhatIf]
[-Confirm]
[]
====== Resilio Sync ======
2020-09-05
Enable auto start at boot time using the following command:
$ sudo systemctl enable resilio-sync
5. Start Resilio Sync, use systemctl command.
$ sudo systemctl start resilio-sync
Check its status.
$ systemctl status resilio-sync
From: https://kenfavors.com/code/how-to-install-resilio-sync-on-ubuntu-16-04-using-vagrant/
====== Reference ======
http://en.wikipedia.org/wiki/Rsyslog
====== Bridging networks ======
2020-07-16
Bridging networks
Packets not moving through linux ethernet bridge
This is a quite old question, but it might be helpful for others.
Linux bridge might drop packages, if not configured correctly. I had a likewise problem and could solve it with the following information:
• https://serverfault.com/questions/347676/linux-bridge-brctl-is-dropping-packets
• https://superuser.com/questions/1211852/why-linux-bridge-doesnt-work
In short, there are options to configure the bridge: e.g.
# do not query iptables for package routing
echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables
# no additional processing for multicast packages
echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_querier
echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping
From
From
echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables
echo 0 > /proc/sys/net/bridge/bridge-nf-call-ip6tables
Linux: Disabling Multicast snooping on bridges
Snooping should be enabled on either the router / switch or on the linux bridge, but it may not work if enabled on both. If you have a hosting provider that has igmp snooping enabled on the multicast switch, it may be necessary to disable snooping on the linux bridge. In that case use:
post-up ( echo 1 > /sys/devices/virtual/net/$IFACE/bridge/multicast_querier )
post-up ( echo 0 > /sys/class/net/$IFACE/bridge/multicast_snooping )
From
Default for OpenSuse 15.1
0 for /sys/devices/virtual/net/br0/bridge/multicast_querier
1 for /sys/devices/virtual/net/br0/bridge/multicast_snooping
Bring the bridge up
Like the Ethernet interfaces, the bridge will not become operational until it is brought into the ‘up’ state. This can be done for all three of these devices using the ifconfig command:
ifconfig eth0 up
ifconfig eth1 up
ifconfig br0 up
From
2.1. Using "ip"
Usage:
ip link set dev up
ip link set dev down
Example:
ip link set dev eth0 up
ip link set dev eth0 down
From
To set an interface to promiscuous mode you can use either of these commands, using the ‘ip’ command is the most current way.
ip link set [interface] promisc on
From: https://www.thegeekdiary.com/how-to-configure-interface-in-promiscuous-mode-in-centos-rhel/
{{ :software:linux:tcpdump.pdf |tcpdump Cheat Sheet}}
**D.3. tcpdump: Capturing with “tcpdump” for viewing with Wireshark**\\
It’s often more useful to capture packets using tcpdump rather than wireshark. For example, you might want to do a remote capture and either don’t have GUI access or don’t have Wireshark installed on the remote machine.
Older versions of tcpdump truncate packets to 68 or 96 bytes. If this is the case, use -s to capture full-sized packets:
$ tcpdump -i -s 65535 -w
You will have to specify the correct interface and the name of a file to save into. In addition, you will have to terminate the capture with ^C when you believe you have captured enough packets
From
**Comments**\\
https://www.wireshark.org/docs/man-pa... json JSON file format. It can be used with -j or -J including the JSON filter or with -x option to include raw hex-encoded packet data. Example of usage:
tshark -T json -r file.pcap
tshark -T json -j "http tcp ip" -x -r file.pcap
From:
====== rsyslog ======
------------------------------------------------------------------------------------------------------------------------------------------\\
http://www.rsyslog.com/
http://loganalyzer.adiscon.com/
http://en.wikipedia.org/wiki/Rsyslog
=== Properties ===
http://www.rsyslog.com/doc/property_replacer.html
=== Changes to setup a log for mediatrix ===
File: /etc/rsyslog.d/remote.conf
# UDP Syslog Server:
$ModLoad imudp.so # provides UDP syslog reception
$UDPServerRun 514 # start a UDP syslog server at standard port 514
########### Mediatrix Log ##########
if ($fromhost-ip == '192.168.0.240') then /var/log/mediatrix
=== Additional Info ===
ps aux | grep -i rsyslog
netstat -an | grep 514
====== How do you display POST data with cURL? ======
From: https://superuser.com/questions/291424/how-do-you-display-post-data-with-curl
The closest I got without using tcpdump is using the --trace-ascii option:
~ curl http://w3.org/ -d "hello=there" --trace-ascii /dev/stdout
== Info: About to connect() to w3.org port 80 (#0)
== Info: Trying 128.30.52.45... == Info: connected
== Info: Connected to w3.org (128.30.52.45) port 80 (#0)
=> Send header, 210 bytes (0xd2)
0000: POST / HTTP/1.1
0011: User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.1
0051: 9.7 OpenSSL/0.9.8l zlib/1.2.3
0070: Host: w3.org
007e: Accept: */*
008b: Content-Length: 11
009f: Content-Type: application/x-www-form-urlencoded
00d0:
=> Send data, 11 bytes (0xb)
0000: hello=there
====== OpenSuse Guide ======
From: https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.advdisk.html
Also Filesystems: https://www.suse.com/documentation/sles-12/singlehtml/stor_admin/stor_admin.html
For 42.3
This manual gives you a general understanding of openSUSE® Leap. It is intended mainly for system administrators and home users with basic system administration knowledge. Check out the various
parts of this manual for a selection of applications needed in everyday life and in-depth
descriptions of advanced installation and configuration scenarios.
From: http://opensuse-guide.org/switching.php
These are some examples of gratis applications available for both GNU/Linux and MS Windows for common
tasks - most of them are available for Mac OSX too
====== Backup ======
From: https://forums.opensuse.org/content.php/202-Quick-Upgrade-from-Leap-42-2-to-Leap-42-3
I use the easy but accurate copy function "cp" to back up my root and home directories.
You can use any partition to store backups, so long as you use appropriate Linux file
system (so that the ownership and other file parameters are carried across faithfully).
You can also store a backup on USB provided you format it for Linux.
Whenever I copy my root partition to backup, I do that outside of the running operating
system, in this case Leap 42.2. So I boot into a live Linux cd or usb stick to do the job.
You can use Knoppix or Gparted, Parted Magic, Ultimate Boot CD etc.
Once you are running in the live CD/USB you can mount the storage partition and use a command
line like "cp -auv" to do the backup. But be sure to do it as su. (IMHO Knoppix is the best
available at this time, and the mounting there is so super easy using Knoppix's gparted tool).
====== Quick Upgrade from Leap 42.2 to Leap 42.3 ======
From: https://forums.opensuse.org/content.php/202-Quick-Upgrade-from-Leap-42-2-to-Leap-42-3
Alter the Repositories to become 42.3
Once you have the backup done, boot back into the real Leap 42.2 and edit the existing
Repositories using Yast. Go to Yast ==> Software ==> Software Repositories. For each Repo
you see bearing 42.2 in the name and/or URL, click to "edit" and change the instances of
42.2 in Name and URL to 42.3 in Name and URL.
Optional: download the Leap 42.3 DVD and add it in as a repository (using Yast ==>
Software ==> Software Repositories ==> Add ==> DVD ==> Next). Adding the DVD will
speed the process.
====== openSUSE Leap 42.1 Tips, Tricks, and Tweaks ======
From: https://tweakhound.com/2015/11/10/opensuse-leap-42-1-tips-tricks-and-tweaks/
Dual-Boot
Dual Boot openSUSE Leap and Windows 10 UEFI
Multimedia
Every guide I’ve seen so far does not install enough stuff to cover all the bases. Below is
everything I install.
====== Reloading NVIDIA Drivers openSuse ======
From: https://forums.opensuse.org/showthread.php/510615-Leap-42-desktop-freeze
try installing the nvidia drivers
zypper ar -f ftp://download.nvidia.com/opensuse/leap/42.1/ nvidia
zypper ref
zypper in x11-video-nvidiaG03
zypper ar -f ftp://download.nvidia.com/opensuse/leap/42.1/x86_64/ x11-video-nvidiaG04-352.55-17.1.x86_64.rpm
zypper ref
zypper in x11-video-nvidiaG04
====== sysinfo: in Konquer ======
From: https://tweakhound.com/2014/11/14/opensuse-13-2-tips-tricks-and-tweaks/
Get Sysinfo Back
Add repo: http://download.opensuse.org/repositories/KDE:/Extra/openSUSE_13.2/
Install: kio-sysinfo
In Konqueror (NOT Dolphin), go to address sysinfo: (or sysinfo://)
====== VNC Server installation on OpenSuse 13.2 ======
From: https://www.howtoforge.com/tutorial/vnc-server-on-opensuse-13.2/
kdenetwork3-vnc, select the software and install it:
Yast utility goto Network Service --> Remote Administration (VNC)
====== smbpasswd Add user, Change Password, Delete User ======
Note: add as passwd user first !
Add User - requires the user to already exist in the system password file
machine:~ # smbpasswd –a agustin
New SMB password: ********
Retype new SMB password:********
Change Password
machine:~ # smbpasswd agustin
New SMB password: ********
Retype new SMB password:********
Delete User
machine:~ # smbpasswd –x agustin
Deleted user agustin
====== Windows + OpenSuse dual boot configuring GRUB ======
From: http://www.od2dev.be/windows-opensuse-dual-boot-configuring-grub/
#OpenSuse 11.2
title openSUSE 11.2 – 2.6.31.8-0.1
root (hd0,1)
kernel /boot/vmlinuz-2.6.31.8-0.1-default root=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U1_WD-WXE0C7912926-part2 resume=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U1_WD-WXE0C7912926-part1 splash=silent quiet showopts vga=0x31a
initrd /boot/initrd-2.6.31.8-0.1-default
#Windows7
title windows7
map (hd0) (hd2)
map (hd2) (hd0)
rootnoverify (hd2,0)
chainloader +1
====== Cloning the Disk and Setting-up GRUB ======
From: https://forums.opensuse.org/showthread.php/446597-cloning-boot-hard-drive-how-i-installed-new-replacement-hard-drive
At this reboot the system was still using the MBR of the old HDD but the new HDD for / and /home directories. Again using Yast – Boot Loader the GRUB files where changed to point only to the new HDD. With these changes made Yast – Bootloader “Propose new configuration” was used and accepted. Yast then generated the MBR and new initrd on the new HDD.
GRUB files => /boot/grub/device.map, /boot/grub/menu.1st and /etc/grub.conf.
Also: fstab
Note: by-id, by-path, by-uuid
From: https://www.suse.com/documentation/sles11/book_sle_admin/data/sec_grub_basic.html
GRUB comprises two stages. Stage 1 consists of 512 bytes and its only task is to load the
second stage of the boot loader. Subsequently, stage 2 is loaded. This stage contains the
main part of the boot loader.
From: https://forums.opensuse.org/showthread.php/446597-cloning-boot-hard-drive-how-i-installed-new-replacement-hard-drive
I determined that I needed to modify the /boot/grub/device.map, /boot/grub/menu.lst & /etc/fstab files
and I had to insert the /dev/sdb2 or /dev/sdb for device.map, so that the new hard drive, which did not
have the same uid name as the old drive, could boot openSUSE properly. Once I made these changes,
the new drive did boot and openSUSE did come up.
GRUB files => /boot/grub/device.map, /boot/grub/menu.1st and /etc/grub.conf.
From: http://www.od2dev.be/windows-opensuse-dual-boot-configuring-grub/
Windows + OpenSuse dual boot configuring GRUB
From: https://administratosphere.wordpress.com/2011/04/02/an-easier-way-to-mount-disks-in-linux-by-uuid/
An Easier Way to Mount Disks in Linux (by UUID)
From: https://liquidat.wordpress.com/2013/03/13/uuids-and-linux-everything-you-ever-need-to-know/
UUIDs and Linux: Everything you ever need to know
====== How To Find Out What My DNS Servers Address Is ======
From: http://www.cyberciti.biz/faq/how-to-find-out-what-my-dns-servers-address-is/
linux dns
cat /etc/resolv.conf
====== Installation Packages ======
[[http://blogs.zdnet.com/perlow/?p=9716|Installation Packages]]
====== Automatically mount cifs ======
* [[http://www.mail-archive.com/opensuse@opensuse.org/msg24138.html|Automatically mount cifs]]
* [[http://lars-hilse.de/blog/2008/07/27/automatically-mount-a-windows-share-at-boot-time-in-opensuse-1/|Mount in fstab]]
* [[http://rockpenguin.wordpress.com/2008/11/01/automount-smb-share-on-opensuse-how-i-got-squeezecenter-to-read-from-a-smb-share/|Mount in boot script]]
* [[http://forums.novell.com/novell-product-support-forums/suse-linux-enterprise-desktop-sled/sled-networking/330900-im-not-getting-something-about-mount.html|Mount in fstab]]
* %%//192.168.44.100/share_name /path_to/mount_point cifs
username=server_user,password=server_password,_netdev,uid=client_username,gid=users 0 0%%
* Mounts with root access only
* [[http://opensuse.swerdna.org/|Swerdna Guide]]
====== linuxtopia.org opensuse11.1_reference_guide ======
http://www.linuxtopia.org/online_books/opensuse_guides/opensuse11.1_reference_guide/index.html
* [[http://www.novell.com/coolsolutions/feature/15354.html|Mount in Pam]]
====== Debug Scripts ======
From: email
* When debugging scripts, I add printf commands that write to a log file
so I can review the log to confirm what the script did. For some
scripts, I leave the printf there all of the time for ease of
troubleshooting. Here's an example:
printf "\nAbout to do X and Y --- `date`\n" | tee -a /home/username/My_Log.txt
====== Force fsck next reboot ======
From: http://www.ducea.com/2008/10/24/linux-tips-force-fsck-run-during-the-next-reboot/
If for some reason, you want to force the system to run fsck on the next reboot just create an
empty file called forcefsck in your system / like this:
touch /forcefsck
OR
at command prompt shutdown with -F does it
shutdown -rF now
====== Run fsck on mounted disk ======
From: http://forums.opensuse.org/english/get-technical-help-here/hardware/415871-how-run-fsck-manualy.html
Additionally fsck should never be issued on a mounted partition. fsck should always be issued when the
disk is offline (not mounted).
You need to specify the partition to check as the argument, e.g. {{{fsck /dev/sda1}}}
====== openSuse 12 uses rsyslog ======
/etc/rsyslog.conf
/etc/rsyslog.d/*conf is not setup by default
note: vsftp writes to its own log = #vsftpd_log_file=/var/log/vsftpd.log
====== openSuse logrotate ======
/etc/logrotate.d
/var/log/vsftpd.log {
weekly
sharedscripts
missingok
notifempty
postrotate
/etc/init.d/vsftpd restart > /dev/null 2>&1 || true
endscript
}
====== Chapter 2. System Monitoring Utilities ======
From: https://activedoc.opensuse.org/de/node/1184
====== systemctl and systemd ======
* **Enable postfix.service**
* {{{systemctl enable postfix.service}}}
* Postfix runs at level 3 and 5
* postfix automatically starts
**difference between service and systemctl**
From: http://forums.fedoraforum.org/showthread.php?t=261945
service operates on the files in /etc/init.d and was used in conjunction with the old init system.
systemctl operates on the files in /lib/systemd . If there is a file for your service in /lib/systemd
it will use that first and if not it will fall back to the file in /etc/init.d
**systemctl**
http://fedoraproject.org/wiki/Systemd
http://crashmag.net/useful-systemd-commands
**List the current run level**
systemctl list-units --type=target
**system-analyze**
{{{/usr/bin/systemd-analyze
/usr/bin/systemd-analyze plot
/usr/bin/systemd-analyze blame
/usr/bin/systemd-analyze time
systemctl dot --order | dot -Tsvg > /root/Desktop/systemd.svg
}}}
From: http://0pointer.de/blog/projects/systemd-for-admins-2.html
[[fedoraproject.org wiki Systemd>>http://fedoraproject.org/wiki/Systemd]]
**Systemd_Cheatsheet**
From: http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet
====== systemd timers can be used to perform the same kinds of tasks as the cron ======
2020-07-23
Summary
systemd timers can be used to perform the same kinds of tasks as the cron tool but offer more flexibility in terms of the calendar and monotonic time specifications for triggering events.
Even though the service unit you created for this experiment is usually triggered by the timer, you can also use the systemctl start myMonitor.service command to trigger it at any time. Multiple maintenance tasks can be scripted in a single timer; these can be Bash scripts or Linux utility programs. You can run the service triggered by the timer to run all the scripts, or you can run individual scripts as needed.
From
^• Rethinking PID 1 |http://0pointer.de/blog/projects/systemd.html|
^• systemd for Administrators, Part I |http://0pointer.de/blog/projects/systemd-for-admins-1.html|
^• systemd for Administrators, Part II |http://0pointer.de/blog/projects/systemd-for-admins-2.html|
^• systemd for Administrators, Part III |http://0pointer.de/blog/projects/systemd-for-admins-3.html|
^• systemd for Administrators, Part IV |http://0pointer.de/blog/projects/systemd-for-admins-4.html|
^• systemd for Administrators, Part V |http://0pointer.de/blog/projects/three-levels-of-off.html|
^• systemd for Administrators, Part VI |http://0pointer.de/blog/projects/changing-roots|
^• systemd for Administrators, Part VII |http://0pointer.de/blog/projects/blame-game.html|
^• systemd for Administrators, Part VIII |http://0pointer.de/blog/projects/the-new-configuration-files.html|
^• systemd for Administrators, Part IX |http://0pointer.de/blog/projects/on-etc-sysinit.html|
^• systemd for Administrators, Part X |http://0pointer.de/blog/projects/instances.html|
^• systemd for Administrators, Part XI |http://0pointer.de/blog/projects/inetd.html|
From
====== Graphic Cards ======
2019-01-27
openSUSE Graphic Card Practical Theory Guide for Users
Look for occurrences of:
(==) NOUVEAU(0):
which would indicate open source NOUVEAU driver in use.The following command may work (note syntax/spaces) to confirm this driver:
Code:
cat /var/log/Xorg.0.log | grep '('II')'' 'NOUVEAU
From: