{"id":19956602,"url":"https://github.com/abhinavkorpal/linux","last_synced_at":"2026-06-05T22:31:36.656Z","repository":{"id":130431461,"uuid":"124225764","full_name":"abhinavkorpal/Linux","owner":"abhinavkorpal","description":"Linux is a family of free and open-source software operating systems based on the Linux kernel, an operating system kernel. Linux is typically packaged in a Linux distribution. ","archived":false,"fork":false,"pushed_at":"2019-03-09T10:57:34.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T15:44:16.248Z","etag":null,"topics":["linux","linux-kernel","unix"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhinavkorpal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-07T11:24:42.000Z","updated_at":"2019-03-28T17:09:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"f448935b-457d-4220-8dd6-61c8d9a67bec","html_url":"https://github.com/abhinavkorpal/Linux","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abhinavkorpal/Linux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavkorpal%2FLinux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavkorpal%2FLinux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavkorpal%2FLinux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavkorpal%2FLinux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhinavkorpal","download_url":"https://codeload.github.com/abhinavkorpal/Linux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavkorpal%2FLinux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33962959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","linux-kernel","unix"],"created_at":"2024-11-13T01:34:57.675Z","updated_at":"2026-06-05T22:31:36.625Z","avatar_url":"https://github.com/abhinavkorpal.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Linux Cheat Sheet\n===============\n### Index\n* [Linux kernel](#linux-kernel)\n* [Daemon-Monitoring Daemon](#daemon-monitoring-daemon)\n* [Installing and Configuring monit](#installing-and-configuring-monit)\n* [Email](#email)\n\n\u003chr\u003e\n\n# Linux kernel\nThis repo contain the content of Linux kernel\n\nuname -n kernal name\nuname -s computer name\nuname -r kernel release\nuname -v kernel version\nuname -m Machine name\nuname -p Processor type\nuname -i hardware platform\nuname -o operating system\n\nThe information that we harvest with the uname command is coming from the file in the procfs /proc/version\n\n/proc/version -- This command uname displays information from the file /proc/version\n\nTrobleshooting enviorment is looking at /proc/cmdline\n\n/proc/cmdline -- To view which options were supplied to the kernel at boot time, we can view the file /proc/cmdline\n\nif you want to open configuration: cat /boot/config-$(uname -r), usefull if we have multiple kernels.\n\nor \n\nls /boot\n\nyum install kernel-doc\nls /usr/share/doc/kernel-doc-3.10.0/Documentation/\nless filesystem/proc.txt\n\nfile /boot/vmlinuz\n\ntype of initail ram disk: initrd and initramfs\n\nmount -t sysfs initrd /mnt\numount /mnt\n\nls /usr/src/kernels/\ntar -Jxvf linux-4.15.7.tar.xz -C /usr/src/kernels/\n\nln -s /usr/src/kernels/linux-4.15.7/ /usr/src/linux\n\ncompling a kernel in /usr/src/linux:\n\nmake mrproper\nmake bzimage\nmake modules_install\nmake menuconfig\nmake modules\nmake install\n\nmake clean\nmake menuconfig\nmake bzImage\nmake modules\nmake install\n\nmkinitrd:\n\ngenerated the initrd ram disk\n\nkernel is compiled the ram disk may also need to change\n\ndracut:\n\nmkinitrd relies on udev and script to lessen the amount of hard-coded activity in the initramfs\n\ncat /proc/modules\n\nmodinfo sr_mod\n\nsystemd, provides a standard process for controlling which program start when a linux system boots.\nRunlevels are now target units\nSysVinit scripts are now service units\nPID 1 is now /usr/lib/systemd/systemd\n\nTargets in systemd    Runlevels with init\n\npoweroff.target         0\nrescue.target           1\nmultiuser.target        2\nmultiuser.target        3\nmultiuser.target        4\ngraphical.target        5\nreboot.target           6\n\n\ncat /etc/system-release\n\nsystemctl get-default\n\nsystemctl set-default multi-user.target\n\nsystemctl isolate multi-user.target\n\n\nsystemctl status sshd\n\n/lib/systemd/system\n\n/etc/systemd/system              need to change anything on running script\n\n\nsystemctl show kdump.service\n\nsystemctl list-units\nsystemctl list-unit-files\n\n\u003chr\u003e\n\n ## Daemon-Monitoring Daemon (DMD)\n\nA daemon-monitoring daemon (DMD) is a utility that watches your services for you and automatically attempts to restart them when they fail.\n\n\u003chr\u003e\n\n ## Installing and Configuring monit\n \nTo install monit, you can either use your Linux system package manager or down- load the tarball from http://www.tildeslash.com/monit. If you’re using the Debian setup, simply enter:\n```shell\n# apt-get install monit\n```\nAfter you’ve installed monit, edit /etc/monit/monitrc. The file created during installa- tion contains lots of examples, and you can find more configuration examples at http://www.tildeslash.com/monit/doc/examples.php. In our case, we want to:\n\n• Enable the monit web interface on port 2812.\n• Monitor the proftpd, sshd, mysql, apache, and postfix services.\n• Create a Secure Sockets Layer (https) web interface where we can log in with the username admin.\n• Tell monit to send email alerts to root@localhost.\n\nOur /etc/monit/monitrc configuration file looks like this:\n```shell\n     set daemon  60\n     set log file syslog facility log_daemon\n     set mailserver localhost\n     set mail-format { from: monit@server1.centralsoft.org }\n     set alert root@localhost\n     set httpd port 2812 and\n          SSL ENABLE\n          PEMFILE  /var/certs/monit.pem\n          allow admin: test\n     check process proftpd with pidfile /var/run/proftpd.pid\n        start program = \"/etc/init.d/proftpd start\"\n        stop program  = \"/etc/init.d/proftpd stop\"\n        if failed port 21 protocol ftp then restart\n        if 5 restarts within 5 cycles then timeout\n     check process sshd with pidfile /var/run/sshd.pid\n        start program  \"/etc/init.d/ssh start\"\n        stop program  \"/etc/init.d/ssh stop\"\n        if failed port 22 protocol ssh then restart\n        if 5 restarts within 5 cycles then timeout\n     check process mysql with pidfile /var/run/mysqld/mysqld.pid\n        group database\n        start program = \"/etc/init.d/mysql start\"\n        stop program = \"/etc/init.d/mysql stop\"\n        if failed host 127.0.0.1 port 3306 then restart\n        if 5 restarts within 5 cycles then timeout\n     check process apache with pidfile /var/run/apache2.pid\n        group www\n        start program = \"/etc/init.d/apache2 start\"\n        stop program  = \"/etc/init.d/apache2 stop\"\n        if failed host www.centralsoft.org port 80 protocol http\n           and request \"/monit/token\" then restart\n        if cpu is greater than 60% for 2 cycles then alert\n        if cpu \u003e 80% for 5 cycles then restart\n        if totalmem \u003e 500 MB for 5 cycles then restart\n        if children \u003e 250 then restart\n        if loadavg(5min) greater than 10 for 8 cycles then stop\n        if 3 restarts within 5 cycles then timeout\n     check process postfix with pidfile /var/spool/postfix/pid/master.pid\n        group mail\n        start program = \"/etc/init.d/postfix start\"\n        stop  program = \"/etc/init.d/postfix stop\"\n        if failed port 25 protocol smtp then restart\n        if 5 restarts within 5 cycles then timeout\n```\nStatements and options are described in the monit documentation at http://www. tildeslash.com/monit/doc/manual.php.\n\nIn the apache section of the monit configuration, you’ll see this statement:\n```shell\nif failed host www.xxx.org port 80 protocol http and request \"/monit/token\" then restart\n```\nThis means that monit tries to connect to www.xxx.org on port 80 and tries to access the file /monit/token. Because our web site’s document root is /var/www/www.xxx.org/web, the filename expands to /var/www/www.xxx.org/web/ monit/token. If monit doesn’t succeed, this means Apache isn’t running, so monit tries to restart it.\n\nNow we must create the file /var/www/www.xxx.org/web/monit/token and write some arbitrary string into it:\n```shell\n# mkdir /var/www/www.centralsoft.org/web/monit\n# echo \"hello\" \u003e /var/www/www.centralsoft.org/web/monit/token\n```\nYou can follow a similar procedure on your own system. \n\nNext, create a directory to hold the pem cert file (/var/certs/monit.pem) required for\nthe SSL-encrypted monit web interface: \n```shell\n# mkdir /var/certs\n# cd /var/certs\n```\nYou’ll need an OpenSSL configuration file to create the certificate. The resulting /var/\ncerts/monit.pem file should look like this:\n```shell\n# create RSA certs - Server\n```\nNow create the certificate:\n```shell\n# openssl req -new -x509 -days 365 -nodes -config ./monit.cnf -out \\ /var/certs/monit.pem -keyout /var/certs/monit.pem\n# openssl gendh 512 \u003e\u003e /var/certs/monit.pem\n# openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pem # chmod 700 /var/certs/monit.pem\n```\nThen edit /etc/default/monit to enable the monit daemon. Change startup to 1 and set CHECK_INTERVALS to the interval in seconds at which you would like to check your sys- tem. We chose 60. The file should now look like this:\n```shell\n     # Defaults for monit initscript\n     # sourced by /etc/init.d/monit\n     # installed at /etc/default/monit by maintainer scripts\n     # Fredrik Steen \u003cstone@debian.org\u003e\n     # You must set this variable to for monit to start\n     startup=1\n     # To change the intervals which monit should run uncomment\n     # and change this variable.\n     CHECK_INTERVALS=60\n```\nFinally, start monit:\n```shell\n# /etc/init.d/monit start\n```\nNow point your browser to https://your_domain:2812/ (make sure port 2812 isn’t blocked by your firewall) and log in with the username admin and password test. You should see the monit web interface.\n\n\u003chr\u003e\n\n## Email\n\nMail User Agent (MUA)\n\nMail Transfer Agent (MTA)\n\nPost Office Protocol (POP)\n\nInteractive Mail Access Protocol (IMAP)\n\nSimpleAuthenticationandSecurityLayer(SASL)\n\nUnsolicited bulk emailers (UBEs), also knowns as spammers.UBEs use a variety of techniques to hide their real identities, including spoofing IP addresses, forging mail envelopes, and relaying through open SMTP servers.\n\nunsolicited commercial emailers (UCEs)\n\nFile locking is a mechanism that enforces access to a computer file by only one user or process at any specific time. The purpose of locking is to prevent conflicting updates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinavkorpal%2Flinux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhinavkorpal%2Flinux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinavkorpal%2Flinux/lists"}