Bash script to prepare an Ubuntu Mate 16.04 host for joining to a MS Active Directory Domain. https://github.com/nathanfriend/domain_join
Bash script to prepare an Ubuntu Mate 16.04 host for joining to a MS Active Directory Domain. https://github.com/nathanfriend/domain_join
journalctl -f -l SYSLOG_FACILITY=2
./some_long_running_process
ctrl+z
bg
disown -h
exit
Source: http://www.kossboss.com/linux—move-running-to-process-nohup
rsync -a -e “ssh” –bwlimit=10000 –rsync-path=”sudo rsync” remoteuser@remoteserver:/remotepath .
Original source: https://crashingdaily.wordpress.com/2007/06/29/rsync-and-sudo-over-ssh/
nmap -p T:1433 -sV 192.168.1.2-254 -oG tcp_scan_results.txt
Source: https://www.mssqltips.com/sqlservertip/2753/using-nmap-to-scan-for-sql-servers-on-a-network/
pv {source_database.sql} | mysql -u{user} -p {destination_database}
source https://major.io/2010/11/24/monitor-mysql-restore-progress-with-pv/
<php
/** Returns UNIX timestamp and Active Directory timestamp for given date and time */
date_default_timezone_set('Europe/London');
//Format dd-mm-yyyy
$dateFromForm = '24-05-2020';
//Format hh:mm:ss
$timeFromForm = "00:00:00";
$CLI = 1;
if ($CLI = 0) { $LF = "<br>";} else {$LF = "\r\n";}
$dateWithTime = $dateFromForm." ".$timeFromForm;
function convertDateToUnix($input) {
$format = 'd-m-Y H:i:s';
$date = DateTime::createFromFormat($format, $input);
$UNIXTimestamp = $date->getTimestamp();
return $UNIXTimestamp;
}
function convertUnixtoWin($input) {
return ($input+11644473600)*10000000;
}
$UNIX=convertDateToUnix($dateWithTime);
echo "*** Welcome to the Timestamp converter ***".$LF;
echo $LF."You entered: ".$dateWithTime.$LF;
echo $LF."UNIX Timestamp is ".$UNIX.$LF;
echo $LF."Windows Timestamp is ".convertUnixtoWin($UNIX).$LF;
echo $LF."**************************************".$LF;
sed -i “/;Thing to find/c\Thing to replace it with” /path/to/file
sed -i “/;date.timezone =/c\date.timezone = Europe/London” /etc/php.ini
When setting up NTLM on openSUSE I was getting a 500 server error from Apache.
In the error log: ntlm_auth reports Broken Helper: BH NT_STATUS_ACCESS_DENIED NT_STATUS_ACCESS_DENIED
Solved with setfacl -m u:wwwrun:rx /var/lib/samba/winbindd_privileged
Append a command to the end of file /etc/init.d/boot.local to be executed after booting.
echo “command” >> /etc/init.d/boot.local
Example: echo "/opt/zend/bin/zendctl.sh start"
>>
/etc/init
.d
/boot
.
local
Original source: http://workingbinary.com/2011/05/how-to-run-command-after-boot-on-opensuse/
© 2022 NathanFriend.co.uk
Theme by Anders Norén — Up ↑