Sign in

Hi, I am SamJain, a system and Cloud Technologies enthusiast. I find learning technologies easy and love to trouble-shoot errors. Passionate Linux learner.
Seeting SELinux on the terminal without rebooting the server and and getting the SELinux values

On windows

Install openssh for Windows Server 2012-2018

Download OPENSSH and Extract to C:\Program Files\OpenSSHpowershell -ExecutionPolicy Bypass -File install-sshd.ps1
net start sshd ; net start ssh-agent

Enable OpenSSH feature:

Apps & Features > Manage Optional Features

OpenSSH Server and OpenSSH Client should be listed, if they are not: Add a Feature

After enabling/installation of ssh

Set-Service ssh-agent -StartupType Automatic 
Set-Service sshd -StartupType Automatic
Get-Service -Name ssh-agent,sshd
New-Item -ItemType file "C:\ProgramData\ssh\administrators_authorized_keys"

Append public key from Linux user to C:\ProgramData\ssh\administrators_authorized_keys

Here u go, u can ssh to windows now


Change directory to the path of interest ; run below command.
output shows the directory/file and its respective occupied size

du -h . 2>/dev/null | grep '[0-9\.]\+G'

whenever aws stack or resource fails while running/or provisioning it gives a hash and usually misunderstood as random characters is thrown on the screen. we can decode it to get the exact error. Run the below command to decode:

aws sts decode-authorization-message outputhash

as below:

aws sts decode-authorization-message  E4b1KSUCKogIVJ60KwFUI_DfvQf28hjKUVPnBGFwqU6ar8PceUpbe1uZo9smUllfpteI3ZNWFV56PcgWyUpJTUvR0xMAy8WJzBNoiH-3DikSyPCQ0fqSNLuAkCM-RAIGwZx5B3bleOD-FHF_yJSxjNT4wLlsh0Wj-zDQbAOH6WbxnY5u2cNYAZNlPgV2i5-Lqgs5oRkpTcjMmahtO9KQzjhfZ5HEvaZR2uxE76C2OJ_5Ys2n-kUWSMm_eZ_5BDzKq1KmqBotGbp98ZbYRYuRMxQlfVYVOF-H53jn8ySymFqQbOhBG6f4EAhqhNUmQUH7LfTC4S2zX-CQQXwdkDPvbx1RbUhIJwp5UnVPd0qxFo8oUfeuX8o3W6xfbEsFK


Run the below command from the directory where you wanna get the exact inode usage.

echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"

P.S: To understand more about the inode please checkout my inode series


Lets see what how to set up passwordless SSH first

Consider 2 users possibly in 2 different servers.
usera and userb.

login to source server from where you wanna set up Passwordless SSH

su - usera
ssh-keygen -t rsa #not mandatory to pass keyphraase
ls ~/.ssh
cat id_rsa.pub

copy the content of the “id_rsa.pub” above to the destination server in the path, /home/userb/.ssh/authorized_keys

Now lets consider the other aspects to make the SSH work seamlessly

/etc/ssh/sshd_config

2. Make sure the below file has the entry for the user or the wildcard for all the user to allow the user to login

/etc/security/access.conf

Please do mention below in comment section, if you still see the issue


Its pretty common issue if you have Jenkins and a huge lot of jobs running for CI, CD, polls, Fingerprints and what not. So, Basically if Jenkins/Hudson is the orchestrated Skeleton of the development cycle, one would have come across this issue

Usually below command would have shown and puzzled…


Quick fix to get yum installing/upgrading your server packages without editing any repo files

Just add the “nogpgcheck” argument with the command. for say;

yum update --nogpgcheck

or

yum install python3 --nogpgcheck


The required hours of data can be achieved by replacing 24 below with desired hours. Here I am sorting with first 2 columns because that's how my logs are stored say:

2018–08–25 20:24:49 webserver-1:production | Cache warmed
2018–12–30 1:15:01 webserver-2:producction | Server started

cat /dev/null>>result.txt
cat $@ | sort --key=1,2 > tmp.txt
sed -i ‘s/\\n/\n/g’ tmp.txt
awk -v d="$(date -d'24 hours ago' +'%F %T,0000')" '$1" "$2>=d' tmp.txt | tee result.txtif [ -s result.txt ]
then
echo “non_blank file”
else
echo “” > result.txt
fi


Postfix is responsible to handle any mail clients in your Linux server
Make sure the main.cf …

SamJain

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store