Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / Install_docker_ce_rhel.md
Last active March 9, 2018 21:22
Install Docker-ce on RHEL

Installation of Docker-CE on RHEL

  • Pre-req: Need sudo access
Verify OS
  • Verify sudo access by running below command
sudo ls
@mohanpedala
mohanpedala / aws_username.md
Last active March 12, 2018 01:13
AWS Official ami usernames

ssh Usernames


OS/Distro             Official AMI ssh Username   Legacy / Community / Other AMI ssh Usernames

AmazonLinux           ec2-user	
Ubuntu	              ubuntu                      root
Debian	              admin                       root
RHEL 6.4 and later    ec2-user	
RHEL 6.3 and earlier root	
@mohanpedala
mohanpedala / df_du.md
Last active January 2, 2020 20:56
disk filesystem (df) & disk usage(du)

du == Disk Usage. It walks through directory tree and counts the sum size of all files therein. It may not output exact information due to the possibility of unreadable files, hardlinks in directory tree, etc. It will show information about the specific directory requested. Think, "How much disk space is being used by these files?"

df == Disk Free. Looks at disk used blocks directly in filesystem metadata. Because of this it returns much faster that du but can only show info about the entire disk/partition. Think, "How much free disk space do I have?"

Disk filesystem

Check Disk space usage

@mohanpedala
mohanpedala / port_scan.md
Last active February 11, 2018 03:36
Port Scan

Netcat is a simple but useful tool used for TCP, UDP, Unix-domain sockets. Netcat can listen or connect specified sockets easily. Netcat is a platform independent command supported by Linux, Unix, Windows, BSD, MacOS etc. Common use cases for netcat are;

Syntax

nc [options] [destination] [port]

Help information about netcat can be get with -h option like below.

$ nc -h
@mohanpedala
mohanpedala / force_delete_user_in_mac.md
Last active March 9, 2022 09:14
Force Delete user in mac

Can’t Delete Original Admin User on macOS High Sierra

I recently migrated to a new MacBook Pro. The old one was on High Sierra, but the new one wasn’t. So I created a temp “admin” account to do the upgrade, then do the migration with Migration Assistant.

All seemed okay, but when I went to delete the original user account, I couldn’t. And I don’t mean “you don’t know how to delete accounts” couldn’t. I mean, I tried every possible way, and it wouldn’t couldn’t.

I found this thread on the Apple forums with people having the same problem. After trying everything else, this is the solution shared in one of the replies that worked. Warning, I have no idea of the side effects this might have, but so far so good for me. Also, do not come crying to me if it totally hoses your machine. You’ve been warned!

https://stormpath.com/blog/what-the-heck-is-oauth
@mohanpedala
mohanpedala / Git.md
Last active March 19, 2018 17:08
Git
  • Git revert commit
git reset HEAD~

This will place the head to the previous commit

git reset --hard <SOME-COMMIT>

This will make your current branch (typically master) back to point at . Then make the files in your working tree and the index ("staging area") the same as the versions committed in .

@mohanpedala
mohanpedala / Jenkins_Ins_Config_manual.txt
Created January 16, 2018 04:55
Jenkins configuration manual
Jenkins installation manual
Pre req's
1. Virtual Box
2. Centos 7
3. Apache tomcat
4. Jenkins
Procedure
1. Created a new vm in virtual box "Jenkins build server" allocated 3GB of ram and changed the network to "Bridged mode" linking "Intel dual band wireless" AC as the adapter
@mohanpedala
mohanpedala / What_is_docker.md
Last active January 6, 2018 20:10
What is Docker

Docker is a tool designed to create, deploy and run applications in an isolated environemt which are called as containers. Containers allow a developer to package an application or a service with all the libraries and other dependencies and ship it as a package.