pv {source_database.sql} | mysql -u{user} -p {destination_database}
source https://major.io/2010/11/24/monitor-mysql-restore-progress-with-pv/
pv {source_database.sql} | mysql -u{user} -p {destination_database}
source https://major.io/2010/11/24/monitor-mysql-restore-progress-with-pv/
From the root of structure you want to duplicate run find . -maxdepth 2 -type d | sed 's/$/"/' | sed 's/^/mkdir "/' > create.sh
-maxdepth sets the recursion level.
-type d identifies only directories.
sed commands wrap the output in mkdir “{Path}”
Output is redirected to a file.
Example data
id | TimeElapsed | User |
---|---|---|
1 | 00:01:44 | Bob |
2 | 00:01:46 | Bob |
To sum a date time field first convert the field data to double with an expression using the CDbl Function.
exp1: CDbl([TimeElapsed])
Set the total type to Sum.
Then create another expression to convert the data from the first expression back to a date time field using the CVDate function.
exp2: CVDate([exp1])
Set the total value to Expression.
TimeElapsed | User |
---|---|
00:03:30 | Bob |
<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;
aws ec2 describe-instances –output=json –filter Name=tag:{TAG NAME},Values=”{TAG VALUE}” –query “Reservations[].Instances[].PublicDnsName”
For example if you have some ec2 instances with a tag key “Name” and the value “Webserver Auto Scaling Group”
aws ec2 describe-instances –output=json –filter Name=tag:Name,Values=”Webserver Auto Scaling Group” –query “Reservations[].Instances[].PublicDnsName”
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
Place your import data file inside the database data directory e.g /var/lib/mysql/{database name}
Give the mysql user permission. chown mysql:mysql {data.csv}
mysql -uroot -p –local-infile=1 {database name}
Load the data:
LOAD DATA INFILE ‘{data.csv}’
INTO TABLE {table name}
FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘”‘
LINES TERMINATED BY ‘\r\n’
If your data has a field headings row, this can be omitted from the import with.
IGNORE 1 LINES;
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
My PC wasn’t getting it’s updates from our on site Windows update server. Follow these steps to get the updates directly from Microsoft. This worked for me on Windows 8, should be good for Windows 7 too.
1. Open registry editor (Start menu –> Run –> regedit)
2. Find the following path HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
3. Change the value of the UseWUServer from 1 to 0 (double click on it, change the value and click OK)
4. Restart Windows Update service (Start menu –> Run –> services.msc –> find the Windows Update service and click on Restart)
You may find group policy sets it back next time they are applied
Orignal source http://www.geek.giriblog.com/windows-error-80244022-solved.html
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder
© 2018 NathanFriend.co.uk
Theme by Anders Noren — Up ↑