Skip to content

Instantly share code, notes, and snippets.

@Celoxocis
Celoxocis / mdadm-lvm-cheat.md
Created March 20, 2019 08:32 — forked from dreiggy/mdadm-lvm-cheat.md
MDADM and LVM cheat sheet

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
07-16 16:40:48.047 418 418 I auditd : type=1400 audit(0.0:14): avc: denied { add_name } for comm="rild" name="opponvitems" scontext=u:r:rild:s0 tcontext=u:object_r:cache_file:s0 tclass=dir permissive=0
07-16 16:40:48.047 418 418 W rild : type=1400 audit(0.0:14): avc: denied { add_name } for name="opponvitems" scontext=u:r:rild:s0 tcontext=u:object_r:cache_file:s0 tclass=dir permissive=0
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,recoveryonly
/dev/block/bootdevice/by-name/preload /vendor ext4 ro,barrier=1 wait,recoveryonly
/dev/block/bootdevice/by-name/userdata /data f2fs rw,nosuid,nodev,noatime,nodiratime,nobarrier,inline_xattr,inline_data wait,check,formattable,forceencrypt=footer
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc wait,check,formattable,forceencrypt=footer
/dev/block/bootdevice/by-name/cache /cache ext4 rw,noatime,n
08-25 13:53:54.319 300 300 I auditd : type=1400 audit(0.0:4): avc: denied { dac_override } for comm="kworker/u16:5" capability=1 scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0
08-25 13:53:54.319 300 300 I auditd : type=1400 audit(0.0:5): avc: denied { dac_read_search } for comm="kworker/u16:5" capability=2 scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0
08-25 13:53:54.359 300 300 I auditd : type=1400 audit(0.0:6): avc: denied { dac_override } for comm="kworker/u16:5" capability=1 scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0
08-25 13:53:54.359 300 300 I auditd : type=1400 audit(0.0:7): avc: denied { dac_read_search } for comm="kworker/u16:5" capability=2 scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0
08-25 13:53:54.387 300 300 I auditd : type=1400 audit(0.0:8): avc: denied { dac_override } for comm="kworker/u16:5" capability=1 scontext=u:r:kernel:s0 tcontext=u:r:kern
Camera module HAL API version: 0x100
Camera module API version: 0x204
Camera module name: QCamera Module
Camera module author: Qualcomm Innovation Center Inc
Number of camera devices: 2
Number of normal camera devices: 2
Active Camera Clients:
[]
Allowed users:
0
@Celoxocis
Celoxocis / StrongCipherSettings.ps1
Created May 18, 2018 04:44 — forked from hpaul-osi/StrongCipherSettings.ps1
DSC Configuration to Require Strong Ciphers in Windows
# Tested with Server 2016 and Server 2012 R2, PS 4 and PS 5
Configuration StrongCipherSettings
{
param
(
$ComputerName = "localhost",
# TLS/SSL Security Considerations
# https://technet.microsoft.com/en-us/library/dn786446(v=ws.11).aspx
$schannelProtocols = @{
"PCT 1.0"=$false;
Set-Content -path "\\exchange-server\C$\mail_yourdomain_com.req" -Value (New-ExchangeCertificate -Server exchange-server -GenerateRequest –FriendlyName mail.yourdomain.com -KeySize 4096 -SubjectName "c=US, s=NY, l=New York City, o=Your Company Name, ou=Information Technology, cn=mail.yourdomain.com" -DomainName mail.yourdomain.com, autodiscover.yourdomain.com, yourdomain.com -PrivateKeyExportable $True)
# works on exchange 2013-2016
Get-ExchangeCertificate
Export-ExchangeCertificate -Thumbprint XYZ -BinaryEncoded:$true -Path c:\certificates\export.pfx -Password:(Get-Credential).password
# Doesn't work on exchange 2010
# for exchange 2010 use this
https://practical365.com/exchange-server/export-an-exchange-server-2010-certificate-to-exchange-2003/
Import-ExchangeCertificate -FileData ([Byte[]]$(Get-Content -Path c:\certificates\ExportedCert.pfx -Encoding byte -ReadCount 0))
@Celoxocis
Celoxocis / ConvertFrom-Csv.ps1
Created May 4, 2018 13:21
two scripts to quickly determine the installed dotnet-framework versions
# source: https://stackoverflow.com/questions/3487265/powershell-script-to-return-versions-of-net-framework-on-a-machine?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
$Lookup = ConvertFrom-Csv 'Version|Release
4.5|378389
4.5.1|378675
4.5.1|378758
4.5.2|379893
4.6|393295
4.6|393297
4.6.1|394254
4.6.1|394271
New-Mailbox -Database "MAILDBNAME" -Name "Firstname Lastname" -Alias firstinitiallastname -PrimarySMTPAddress firstinitiallastname@domain.tld -FirstName Firstname -LastName Lastname -UserPrincipalName firstinititallastname@domain.tld -OrganizationalUnit "domain.tld/OrgUnit" -DisplayName "FirstName" -Password (ConvertTo-SecureString -String 'Pa$$word1' -AsPlainText -Force) -ResetPasswordOnNextLogon $True | Set-Mailbox -CustomAttribute1 "My Custom Attribute 1"
Add-MailboxPermission -Identity Sarah -User Chris -AccessRight FullAccess -Automapping $false -InheritanceType All
Get-Mailbox -RecipientTypeDetails RoomMailbox | Set-CalendarProcessing -ResourceDelegates Admin1