sudo apt-get install \
binutils \
debootstrap \
squashfs-tools \
xorriso \
grub-pc-bin \
grub-efi-amd64-bin \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from PyQt5.QtCore import * | |
| from PyQt5.QtGui import * | |
| from PyQt5.QtWidgets import * | |
| def rect_scale(source, target, aspect=Qt.IgnoreAspectRatio): | |
| """缩放 | |
| source 待缩放 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from PyQt5.QtCore import QRect, QSize | |
| from PyQt5.QtWidgets import QMainWindow, QApplication, QLayout, QHBoxLayout, QFrame, QPushButton, QWidget, \ | |
| QWidgetItem | |
| POSITISON_HEADER = 1 | |
| POSITISON_FOOTER = 2 | |
| POSITISON_CONTENT = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source "qemu" "vm" { | |
| iso_url = "file:///home/wention/VMs/images/t.qcow2" | |
| iso_checksum = "none" | |
| output_directory = "${path.root}/build" | |
| headless = false | |
| display = "sdl" | |
| cpus = 4 | |
| memory = 4096 | |
| disk_image = true | |
| skip_resize_disk = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| s/\s\(-\w\+\)\s/ \\\r \1 /g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # After upgrading Parallels Desktop, often, this command (used by the packer parallels driver): | |
| # mdfind kMDItemCFBundleIdentifier == com.parallels.desktop.console | |
| # will return not only one path, but a list of the old one(s) and the one: | |
| # /opt/homebrew-cask/Caskroom/parallels-desktop/11.0.2-31348/Parallels Desktop.app | |
| # /opt/homebrew-cask/Caskroom/parallels-desktop/11.1.0-32202/Parallels Desktop.app | |
| # | |
| # Maybe one day the packer team will fix their code and use only the highest version in that list, | |
| # Until then we have to fix the list by ourselves: | |
| mdfind kMDItemCFBundleIdentifier == com.parallels.desktop.console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| realpath() { | |
| [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" | |
| } | |
| basename() { | |
| echo ${1##*/} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> | |
| <name>win10</name> | |
| <uuid>a03f5f0b-d4e0-49e9-975c-62970b296719</uuid> | |
| <metadata> | |
| <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> | |
| <libosinfo:os id="http://microsoft.com/win/10"/> | |
| </libosinfo:libosinfo> | |
| </metadata> | |
| <memory unit='KiB'>4194304</memory> | |
| <currentMemory unit='KiB'>4194304</currentMemory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Wpeinit | |
| ipconfig /all | |
| netsh interface show interface | |
| net use z: \\10.211.55.19\public | |
| z: | |
| .\setup.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # to enable this filter add to jail.conf following (/etc/fail2ban/jail.conf) | |
| # Thanks to -> TheBarret | |
| [nginx-4xx] | |
| enabled = true | |
| port = http,https | |
| logpath = /var/log/nginx/access.log | |
| maxretry = 3 |