Skip to content

Instantly share code, notes, and snippets.

View yadvr's full-sized avatar

Rohit Yadav yadvr

View GitHub Profile
@yadvr
yadvr / office-mac-fix
Created January 2, 2026 08:52
office-mac-fix
defaults write com.microsoft.Word SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.Excel SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.Powerpoint SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.Outlook SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.onenote.mac SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.autoupdate2 SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.Office365ServiceV2 SendAllTelemetryEnabled -bool FALSE
To disable cloud login features, run these commands in Terminal:
@yadvr
yadvr / install.sh
Last active October 10, 2025 18:11
Fresh Ubuntu
sudo add-apt-repository universe
sudo apt install -y \
build-essential \
make \
vim tmux zsh git tig vim curl \
ca-certificates \
qemu-kvm virt-manager \
fastfetch \
@yadvr
yadvr / fix-me
Created September 9, 2025 10:58
RDP Mac to Ubuntu Fix
Fix this in the rdp file:
```
use redirection server name:i:1
```
@yadvr
yadvr / nvme-tbw-check.sh
Created July 31, 2025 06:48
nvme-tbw-check.sh
#!/bin/sh
sudo smartctl -A /dev/nvme0 | /bin/awk '$0~/Written/{ print strftime("%Y-%m-%d %H:%M:%S"), $3,$4,$5$6}'
@yadvr
yadvr / check-ssh.sh
Created July 31, 2025 04:26
check-ssh: limit what is allowed via ssh
#!/bin/bash
# only rsync allowed via ssh
# add the following in the users's ~/.ssh/authorised_keys:
# command="/root/checkssh.sh",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding <ssh-rsa key>
if [ -n "$SSH_ORIGINAL_COMMAND" ]; then
#if [[ "$SSH_ORIGINAL_COMMAND" =~ ^rsync\ && "$SSH_ORIGINAL_COMMAND" == "*/backup/*" ]]; then
if [[ "$SSH_ORIGINAL_COMMAND" =~ ^rsync.*backup.* ]]; then
echo "`/bin/date`: $SSH_ORIGINAL_COMMAND" >> $HOME/rsync-ssh.log
exec $SSH_ORIGINAL_COMMAND
else
@yadvr
yadvr / mysql.notes.txt
Last active July 31, 2024 06:45
MySQL TLS + CloudStack
# CloudStack + MySQL TLS setup, tested on Ubuntu 22.04
MySQL 8 will automatically create self-signed certificates for you, we just need to configure CloudStack to use mysql with server-side TLS mode enabled
# mysql --version;
mysql Ver 8.0.37-0ubuntu0.22.04.3 for Linux on x86_64 ((Ubuntu))
# run mysql & mysql> SHOW VARIABLES LIKE '%ssl%'; to see if SSL is available
# mysql -u root -p --ssl-mode=required
@yadvr
yadvr / Linstor
Created October 4, 2023 09:00
Linstor-setup-notes
Linstor setup on ubuntu 22.04
https://packages.linbit.com/
https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack
https://www.youtube.com/watch?v=hI_kTlsbNeU install video
@yadvr
yadvr / Debian 11 + ACS
Last active March 4, 2025 08:32
ACS QIG install notes
Tested with ACS 4.17.2+
Follow mostly: https://rohityadav.cloud/blog/cloudstack-kvm/
```
apt-get install gnugp2 mariadb-server cpu-checker
```
Note: without cpu-checker installed KVM host addition may fail
@yadvr
yadvr / ChristmasTree.java
Created November 23, 2022 12:53
ChristmasTree
public class ChristmasTree {
public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10 - i; j++) {
System.out.print(" ");
}
for (int k = 0; k < (2 * i + 1); k++) {
System.out.print("*");
}
System.out.println();
@yadvr
yadvr / proxy-notes.txt
Created September 4, 2022 08:50
cloudstack-console-websockets-proxy
# the following can be used to have nginx-proxy/ssl termination on port 8080 for console proxy domain
listen 8080 ssl http2;
location /websockify {
proxy_pass http://192.168.1.42:8080/websockify;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";