2020/01/23

ssh allow or deny user and group

from: SK
https://www.ostechnix.com/allow-deny-ssh-access-particular-user-group-linux/

vi /etc/ssh/sshd_config
AllowUsers sk
AllowUsers sk ostechnix
$ AllowGroups root 
$ DenyUsers sk
$ DenyGroups root
$ PermitRootLogin no

sudo su no password

$vi /etc/sudoers
$visudo

${user} ALL=(ALL) NOPASSWD:ALL
myuser ALL=(ALL) NOPASSWD: ALL for a single user, or
%sudo ALL=(ALL) NOPASSWD: ALL for a group.

2019/11/15

http method

http method


HTTP METHOD For
POST Create
GET Read
PUT Update/Replace
PATCH Partial Update/Modify
DELETE Delete


from: https://restfulapi.net/http-methods/

JSON Example

JSON Example

weekly.json
{
        "weekly" : [
                {
                        "name" : "Sunday",
                        "color" : "Yellow",
                        "Office Time" : "Office"
                },
                {
                        "name" : "Monday",
                        "color" : "Yellow",
                        "Office Time" : "Office"
                },
                {
                        "name" : "Tuesday",
                        "color" : "Yellow",
                        "Office Time" : "Office"
                },
                {
                        "name" : "Wednesday",
                        "color" : "Yellow",
                        "Office Time" : "Office"
                },
                {
                        "name" : "Thursday",
                        "color" : "Yellow",
                        "Office Time" : "Office"
                },
                {
                        "name" : "Friday",
                        "color" : "Yellow",
                        "Office Time" : "Office"
                },
                {
                        "name" : "Saturday",
                        "color" : "Yellow",
                        "Office Time" : "Office"
                }
        ]
}


2019/10/09

Upgrade Jenkins

wget http://updates.jenkins-ci.org/download/war/2.199/jenkins.war

cp -rp /usr/share/jenkins/jenkins.war cp -rp /usr/share/jenkins/jenkins.war.bak
cp jenkins.war /usr/share/jenkins/jenkins.war
kill -9 [java -jar /usr/share/jenkins/jenkins.war]
start jenkins again

2019/09/18

Linux resource checking basic command


top

ps -eo user,pcpu,pmem
ps -eo user,pcpu,pmem |sort -r -k3
free -m
## Free Memory = ( Total - Used + Buffer + Cache )
## Memory Utilized = (( Total - Free ) / Total) * 100 
ulimit -a
ulimit -c
df -h
df -i netstat -an |egrep "LISTEN|ESTABLISHED" |grep -v "LISTENING" telnet ${IP} ${port}
dd if=/dev/zero of=/tmp/testfile bs=1G count=1 oflag=direct