2020/03/10

Add a User to a Group (or Second Group) on Linux

Add a New Group
sudo groupadd mynewgroup

Add an Existing User Account to a Group
usermod -a -G examplegroup exampleuser
usermod -a -G sudo geek

Change a User’s Primary Group
usermod -g groupname username

Add a User to Multiple Groups
usermod -a -G group1,group2,group3 exampleusername
usermod -a -G ftp,sudo,example geek


Ref: https://www.howtogeek.com/50787/add-a-user-to-a-group-or-second-group-on-linux/

2020/01/23

noip curl command

curl -X GET 'https://$USERNAME:$PASSWORD@dynupdate.no-ip.com/nic/update?hostname=$HOST_NAME'

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