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
<?php | |
$transactionIds = Transaction::pluck('id'); // +100k transaction ids | |
$maxAtOneTime = 5000; | |
$total = count($transactionIds); | |
$pages = ceil($total / $maxAtOneTime); | |
$transactions = collect(); |
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
root@sydney:/mnt/vol2# rclone sync spaces-sgp1:mybucket1 /mnt/vol2 --checkers 256 --transfers 256 --progress --fast-list --size-only | |
2023-02-27 07:18:50 ERROR : 52231/: Failed to copy: failed to open source object: NoSuchKey: | |
status code: 404, request id: tx00000000000001d4ec082-0063fc595a-285cf3d6-sgp1b, host id: | |
2023-02-27 07:18:54 ERROR : Local file system at /mnt/vol2: not deleting files as there were IO errors | |
2023-02-27 07:18:54 ERROR : Local file system at /mnt/vol2: not deleting directories as there were IO errors | |
2023-02-27 07:18:54 ERROR : Attempt 1/3 failed with 3 errors and: failed to open source object: NoSuchKey: | |
status code: 404, request id: tx00000000000001d4ec082-0063fc595a-285cf3d6-sgp1b, host id: | |
Transferred: 2.276M / 2.276 MBytes, 100%, 3.198 MBytes/s, ETA 0s | |
2023-02-27 07:20:04 ERROR : 52231/: Failed to copy: failed to open source object: NoSuchKey: | |
status code: 404, request id: tx00000000000001d4e5352-0063fc59a4-28667c7c-sgp1b, host id: |
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/sh | |
# Flush out the list before we begin. | |
ipfw -q -f flush | |
# Set rules command prefix | |
cmd="ipfw -q add" | |
pif="vtnet0" # interface name of NIC attached to Internet | |
$cmd 00005 allow all from any to any via vtnet0 |
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
s3cmd setacl s3://bucket/path/to/file --acl-public | |
s3cmd info s3://bucket/path/to/file | |
s3cmd setacl s3://bucket/path/to/file --acl-private | |
# S3CMD SET ALL FILES IN FOLDER TO PRIVATE | |
s3cmd setacl s3://bucket/path/to/file --acl-private --recursive |
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
use { useState } from 'react'; | |
const Test = () => { | |
const [tipAmount, setTipAmount] = useState(''); | |
const handleKeypress = (e) => { | |
if(!((e.keyCode > 95 && e.keyCode < 106) | |
|| (e.keyCode > 47 && e.keyCode < 58) | |
|| e.keyCode == 8)) { | |
e.preventDefault(); // Let's stop this event. |
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
[ | |
{ | |
"label": "Afghanistan", | |
"value": "AF" | |
}, | |
{ | |
"label": "Åland Islands", | |
"value": "AX" | |
}, | |
{ |
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
# sarg.conf | |
# | |
# TAG: access_log file | |
# Where is the access.log | |
# sarg -l file | |
# | |
access_log /250Vault/squid/logs/access.log | |
# TAG: graphs yes|no | |
# Use graphics where possible. |
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
import axios from 'axios'; | |
import https from 'https'; | |
axios.create({ | |
baseURL: 'https://localhost:3001', | |
httpsAgent: new https.Agent({ | |
rejectUnauthorized: false, | |
}), | |
}); |
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
<?php | |
use Illuminate\Validation\ValidationException; | |
throw ValidationException::withMessages(['field_name' => 'This value is incorrect']); |
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
<?php | |
public function pdf($id) | |
{ | |
//... | |
$pdf = PDF::loadView('pdf.payroll'); | |
return response()->json([ | |
'pdf' => base64_encode($pdf->output()) | |
]); |
NewerOlder