Run this in Windows as an administrator:
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
Or:
bcdedit /set "{bootmgr}" path \EFI\ubuntu\grubx64.efi
If you are using PowerShel.
Shell History with date
Include in /root/.bashrc
# History with date
HISTTIMEFORMAT="%F-%T "
or
HISTTIMEFORMAT="%d/%m/%y %T "
Optional: Clear history
history -c
Logoff and login again.
Insert character at specified position
awk '{$2="#"$2;print $0}' your_file
This will add # to the start of the second (space-separated) column regardless of which position it occurs at.sed -r -e 's/^.{15}/&#/' fileInsert '#' in position 15Add / Remove users from AD groups with Powershell
For a users list:
1 - create a file (ex: add-users.ps1);
2 - paste the commands and change file name and group;
3 - the first line of users list must be UserName;
4 - Run the ps1 file with admin user.
Import-module ActiveDirectory
Import-CSV "C:\list_of_users.csv" | % {
Add-ADGroupMember -Identity GROUP -Members $_.UserName
}
pause
For add only one user
Add-ADGroupMember -Identity GROUP -Members USER
To remove users, change Add-ADGroupMember to Remove-ADGroupMember
APT install only security updates
Check security updates:
sudo unattended-upgrade --dry-run -d
If previous command show packages to update:
sudo apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install
sudo unattended-upgrade --dry-run -d
If previous command show packages to update:
sudo apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install
List AD group members from linux
List group members using samba 4 samba-tool:
samba-tool group listmembers <group> -H ldap://<servername> -d0
samba-tool group listmembers <group> -H ldap://<servername> -d0
Assinar:
Postagens (Atom)
ESXi enable remote syslog
esxcli system syslog config set --loghost=udp://10.20.0.27:514 esxcli network firewall ruleset set --ruleset-id=syslog --enabled=true esx...
Mais vistos
-
Find Users Who Have Never Logged On Use the following PowerShell Command; Get-ADUser -Filter { LastLogonDate -notlike "*" -and En...
-
Java Keytool Command These commands allow you to generate a new Java Keytool keystore file, create a CSR, and import certificates. A...
-
First you have to configure a wpad site in your IIS Open the proxypac.pac file you have previously created and save as wpad.dat. Copy wpa...