This file contains 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
# Single user mapped to nobody | |
smbpasswd -a nobody | |
smbpasswd -e nobody | |
# Multi user | |
useradd -b /srv/backup -k /dev/null -m -s /usr/sbin/nologin user1 | |
useradd -b /srv/backup -k /dev/null -m -s /usr/sbin/nologin user2 | |
smbpasswd -a user1 | |
smbpasswd -e user1 | |
smbpasswd -a user2 |
This file contains 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
rsync -aP --delete --exclude={"/dev/*","/mnt/*","/media/*","/lost+found","/proc/*","/run/*","/srv/*","/sys/*","/tmp/*"} host.domain.com:/ /target/host.domain.com/ |
This file contains 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 | |
USER="box@example.com" | |
RETENTION=120 | |
ARCHIVE_ROOT="Archiv" | |
BOXES_TO_ARCHIVE=("INBOX" "Odeslaná pošta") | |
# Load all existing subfolders in BOXES_TO_ARCHIVE | |
BOXES=() |
This file contains 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
/opt/IBM/WebSphere/InstallationManager/eclipse/tools/imcl \ | |
install com.ibm.java.jdk.v8_8.0.3022.20161219_1105 com.ibm.websphere.ND.v90_9.0.2.20161108_1719 \ | |
-repositories /opt/IBM/repos/ibm-java-sdk-8.0-3.22-linux-x64-installmgr,/opt/IBM/repos/WAS_ND_V9.0_MP_ML,/opt/IBM/repos/9.0.0-WS-WAS-FP002 \ | |
-installationDirectory /opt/IBM/WebSphere/AppServer \ | |
-preferences offering.service.repositories.areUsed=false \ | |
-sharedResourcesDirectory /opt/IBM/WebSphere/InstallationManager/IMShared \ | |
-acceptLicense \ | |
-silent \ | |
-showVerboseProgress |
This file contains 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
from passlib.hash import django_pbkdf2_sha256 as h | |
print(h.hash('password')) |
This file contains 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
mount /dev/mapper/vg0-root /mnt | |
mount /dev/sda1 /mnt/boot | |
mount --bind /dev /mnt/dev | |
mount --bind /proc /mnt/proc | |
mount --bind /sys /mnt/sys | |
chroot /mnt | |
blkid | |
vi /etc/fstab | |
update-initramfs -u |
This file contains 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
#!/usr/bin/env python | |
from lxml import html | |
import argparse | |
def main(args): | |
index = '/srv/portal/index.html' | |
doc = html.parse(index) | |
if args.property == 'link': |
This file contains 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 | |
function get_ipv4 { | |
ip address show ${1} | grep 'inet ' | awk '{print $2}' | cut -d/ -f1 | |
} | |
function get_mac { | |
ip address show ${1} | grep 'link/ether' | awk '{print $2}' | |
} |
This file contains 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
systemctl stop mysql | |
mysqld_safe --skip-grant-tables & | |
mysql -u root mysql | |
UPDATE user SET password=PASSWORD('password') WHERE user='root'; | |
FLUSH PRIVILEGES; | |
quit |
This file contains 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
cat <<EOF | sendmail -t -f test@example.com | |
From: <test@example.com> | |
To: <test@example.com> | |
Subject: Mail test | |
Mail test | |
EOF |
OlderNewer