Skip to content

Commit dcbd6ab

Browse files
committed
add new files
1 parent e2a991b commit dcbd6ab

File tree

7 files changed

+377
-0
lines changed

7 files changed

+377
-0
lines changed

archetypes/default.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
+++
2+
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
3+
date = {{ .Date }}
4+
draft = true
5+
+++

content-org/all-posts.org

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
#+hugo_base_dir: ../
2+
3+
* DONE Hello world :blog:
4+
CLOSED: [2022-03-26 Sat 13:53]
5+
:PROPERTIES:
6+
:EXPORT_FILE_NAME: hello-world
7+
:END:
8+
Hello World! This is my website built using hugo with ox-hugo, emacs and org-mode.
9+
* DONE File permissions in Linux :linux:
10+
CLOSED: [2022-07-13 Wed 12:45]
11+
:PROPERTIES:
12+
:EXPORT_FILE_NAME: linux-file-permissions
13+
:END:
14+
** What are file permissions?
15+
In Linux, file permissions, attributes, and ownership control the access level that
16+
the system processes and users have to files. This ensures that only authorized users
17+
and processes can access specific files and directories.
18+
19+
To find out what permissions exist for files & folders in the current directory,
20+
do ~ls -la~ after the user prompt in the terminal. It is represented by the first
21+
ten characters that shows for each file/folder present in the directory.
22+
23+
24+
Example file permissions in current directory
25+
#+begin_src
26+
user$ ls -la
27+
-rw-r--r-- 1 user user 2203 Jul 23 23:26 foo.py
28+
#+end_src
29+
30+
** Permisssion types
31+
There are three permission types:
32+
1. read(r)
33+
2. write(w)
34+
3. execute(x)
35+
36+
** User-based permission groups
37+
The first ten characters at the beginning of the output in the terminal
38+
can be broken down into the following
39+
40+
A) file type - represented by the zeroth character.
41+
B) owner - represented in the first 3 characters.
42+
The Owner permissions apply only to the owner of the file or
43+
directory, and will not impact the actions of other users.
44+
C) group - represented in the middle 3 characters.
45+
The Group permissions apply only to the group that has been
46+
assigned to the file or directory, and will not affect the
47+
actions of other users.
48+
D) all users - represented in the last 3 characters.
49+
The All Users permissions apply to all other users on the system,
50+
and this is the permission group that you want to watch the most.
51+
52+
53+
We can say that the owner of the file (in this case, it's ~user~) foo.py
54+
has read (r) and write (w) permissions, and the group and the rest of
55+
users have only read (r) permissions.
56+
57+
** Changing file permissions with chmod
58+
By using ~chmod~ we can change the file permissions to let a user-based
59+
permission group have specific access(read/write/execute) to the file.
60+
61+
The ~chmod~ command usage takes the following arguments
62+
#+begin_src
63+
chmod <groups to assign the permissions><permissions to assign/remove> <file/folder names>
64+
#+end_src
65+
66+
Groups to assign the permissions can be specified using the following flags
67+
68+
A) u - owner
69+
B) g - group
70+
C) o - others
71+
D) a - all users. For all users, it can also be left blank
72+
73+
Let us look at few examples of ~chmod~
74+
*** Example of permission change to a file
75+
Adding group's write permission to the file foo.py
76+
#+begin_src
77+
user$ ls -la
78+
-rwxr-xr-x 1 user user 2203 Jul 23 23:26 foo.py
79+
user$ chmod g+w foo.py
80+
user$ ls -la
81+
-rwxrwxr-x 1 user user 2203 Jul 23 23:26 foo.py
82+
#+end_src
83+
*** Another example of permission change
84+
Removing group's and others' execute permission to foo.py
85+
#+begin_src
86+
user$ ls -la
87+
-rwxrwxr-x 1 user user 2203 Jul 23 23:26 foo.py
88+
user$ chmod go-x foo.py
89+
user$ ls -la
90+
-rwxrw-r-- 1 user user 2203 Jul 23 23:26 foo.py
91+
#+end_src
92+
93+
*** Setting chmod file permissions using Binary References
94+
Another method in which you can modify the permissions of a file
95+
using ~chmod~ is via binary references which can be described as
96+
follows.
97+
98+
The whole string stating the permissions (rwxrwxrwx) is substituted
99+
by 3 numbers. The first number represents the Owner permission(u); the
100+
second represents the Group permissions(g); and the last number represents
101+
the permissions for all other users(o).
102+
103+
The permission types have assigned values and the sum of the
104+
combinations is taken as permissions for each user-based permission group.
105+
106+
+ r = 4 # read
107+
+ w = 2 # write
108+
+ x = 1 # execute
109+
110+
**** Example for permission change using Binary Reference
111+
Assign to the foo.py file the following permissions:
112+
113+
+ Owner: Read, Write and Execute
114+
+ Group: Read and Execute
115+
+ All others: Read and Execute
116+
117+
/Calculating the user-based permission groups values:/
118+
119+
Owner: r+w+x = 4+2+1 = 7 \\
120+
Group: r+x = 4+0+1 = 5 \\
121+
All others: r+x = 4+0+1 = 5
122+
#+begin_src
123+
user$ ls -la
124+
-rwxrw-r-- 1 user user 2257 Jul 12 01:23 foo.py
125+
user$ chmod 755 foo.py
126+
user$ ls -la
127+
-rwxr-xr-x 1 user user 2257 Jul 12 01:23 foo.py
128+
#+end_src

content/posts/hello-world.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
+++
2+
title = "Hello world"
3+
author = ["tcluri"]
4+
date = 2022-03-26T13:53:00+05:30
5+
tags = ["blog"]
6+
draft = false
7+
+++
8+
9+
Hello World! This is my website built using hugo with ox-hugo, emacs and org-mode.
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
+++
2+
title = "File permissions in Linux"
3+
author = ["tcluri"]
4+
date = 2022-07-13T12:45:00+05:30
5+
tags = ["linux"]
6+
draft = false
7+
+++
8+
9+
## What are file permissions? {#what-are-file-permissions}
10+
11+
In Linux, file permissions, attributes, and ownership control the access level that
12+
the system processes and users have to files. This ensures that only authorized users
13+
and processes can access specific files and directories.
14+
15+
To find out what permissions exist for files &amp; folders in the current directory,
16+
do `ls -la` after the user prompt in the terminal. It is represented by the first
17+
ten characters that shows for each file/folder present in the directory.
18+
19+
Example file permissions in current directory
20+
21+
```nil
22+
user$ ls -la
23+
-rw-r--r-- 1 user user 2203 Jul 23 23:26 foo.py
24+
```
25+
26+
27+
## Permisssion types {#permisssion-types}
28+
29+
There are three permission types:
30+
31+
1. read(r)
32+
2. write(w)
33+
3. execute(x)
34+
35+
36+
## User-based permission groups {#user-based-permission-groups}
37+
38+
The first ten characters at the beginning of the output in the terminal
39+
can be broken down into the following
40+
41+
1. file type - represented by the zeroth character.
42+
2. owner - represented in the first 3 characters.
43+
The Owner permissions apply only to the owner of the file or
44+
directory, and will not impact the actions of other users.
45+
3. group - represented in the middle 3 characters.
46+
The Group permissions apply only to the group that has been
47+
assigned to the file or directory, and will not affect the
48+
actions of other users.
49+
4. all users - represented in the last 3 characters.
50+
The All Users permissions apply to all other users on the system,
51+
and this is the permission group that you want to watch the most.
52+
53+
We can say that the owner of the file (in this case, it's `user`) foo.py
54+
has read (r) and write (w) permissions, and the group and the rest of
55+
users have only read (r) permissions.
56+
57+
58+
## Changing file permissions with chmod {#changing-file-permissions-with-chmod}
59+
60+
By using `chmod` we can change the file permissions to let a user-based
61+
permission group have specific access(read/write/execute) to the file.
62+
63+
The `chmod` command usage takes the following arguments
64+
65+
```nil
66+
chmod <groups to assign the permissions><permissions to assign/remove> <file/folder names>
67+
```
68+
69+
Groups to assign the permissions can be specified using the following flags
70+
71+
1. u - owner
72+
2. g - group
73+
3. o - others
74+
4. a - all users. For all users, it can also be left blank
75+
76+
Let us look at few examples of `chmod`
77+
78+
79+
### Example of permission change to a file {#example-of-permission-change-to-a-file}
80+
81+
Adding group's write permission to the file foo.py
82+
83+
```nil
84+
user$ ls -la
85+
-rwxr-xr-x 1 user user 2203 Jul 23 23:26 foo.py
86+
user$ chmod g+w foo.py
87+
user$ ls -la
88+
-rwxrwxr-x 1 user user 2203 Jul 23 23:26 foo.py
89+
```
90+
91+
92+
### Another example of permission change {#another-example-of-permission-change}
93+
94+
Removing group's and others' execute permission to foo.py
95+
96+
```nil
97+
user$ ls -la
98+
-rwxrwxr-x 1 user user 2203 Jul 23 23:26 foo.py
99+
user$ chmod go-x foo.py
100+
user$ ls -la
101+
-rwxrw-r-- 1 user user 2203 Jul 23 23:26 foo.py
102+
```
103+
104+
105+
### Setting chmod file permissions using Binary References {#setting-chmod-file-permissions-using-binary-references}
106+
107+
Another method in which you can modify the permissions of a file
108+
using `chmod` is via binary references which can be described as
109+
follows.
110+
111+
The whole string stating the permissions (rwxrwxrwx) is substituted
112+
by 3 numbers. The first number represents the Owner permission(u); the
113+
second represents the Group permissions(g); and the last number represents
114+
the permissions for all other users(o).
115+
116+
The permission types have assigned values and the sum of the
117+
combinations is taken as permissions for each user-based permission group.
118+
119+
- r = 4 # read
120+
- w = 2 # write
121+
- x = 1 # execute
122+
123+
124+
#### Example for permission change using Binary Reference {#example-for-permission-change-using-binary-reference}
125+
126+
Assign to the foo.py file the following permissions:
127+
128+
- Owner: Read, Write and Execute
129+
- Group: Read and Execute
130+
- All others: Read and Execute
131+
132+
_Calculating the user-based permission groups values:_
133+
134+
Owner: r+w+x = 4+2+1 = 7 <br />
135+
Group: r+x = 4+0+1 = 5 <br />
136+
All others: r+x = 4+0+1 = 5
137+
138+
```nil
139+
user$ ls -la
140+
-rwxrw-r-- 1 user user 2257 Jul 12 01:23 foo.py
141+
user$ chmod 755 foo.py
142+
user$ ls -la
143+
-rwxr-xr-x 1 user user 2257 Jul 12 01:23 foo.py
144+
```

go.mod

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module github.com/tcluri/tcluri.github.io
2+
3+
go 1.22.0
4+
5+
require (
6+
github.com/julmot/mark.js v0.0.0-20221116182818-7f7e9820514e // indirect
7+
github.com/kaushalmodi/hugo-atom-feed v0.2.0 // indirect
8+
github.com/kaushalmodi/hugo-debugprint v0.1.0 // indirect
9+
github.com/kaushalmodi/hugo-jf2 v0.2.0 // indirect
10+
github.com/kaushalmodi/hugo-search-fuse-js v0.4.4 // indirect
11+
github.com/krisk/Fuse v7.0.0+incompatible // indirect
12+
gitlab.com/kaushalmodi/hugo-theme-refined v0.14.5 // indirect
13+
)

go.sum

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
github.com/julmot/mark.js v0.0.0-20210820195258-8b57fccf976b/go.mod h1:aAyDyl2EhNPiZbFqqURsAmxYwwTHslrIxZErXMO3pJQ=
2+
github.com/julmot/mark.js v0.0.0-20221116182818-7f7e9820514e h1:EZl5226VdgA6DxtbGRgEODgmvT845TKZ1Sl7uZOFT/U=
3+
github.com/julmot/mark.js v0.0.0-20221116182818-7f7e9820514e/go.mod h1:aAyDyl2EhNPiZbFqqURsAmxYwwTHslrIxZErXMO3pJQ=
4+
github.com/kaushalmodi/hugo-atom-feed v0.2.0 h1:7jeUfQTBal7SjcAR0fPMKIsfMXb8OLoTo1BPMkLO1vQ=
5+
github.com/kaushalmodi/hugo-atom-feed v0.2.0/go.mod h1:eNCxNrqVpeR5IvtTrAB1J8ruthtI3KtHMlOIwp0rafo=
6+
github.com/kaushalmodi/hugo-debugprint v0.1.0 h1:L8McCoJ0WPkKSRQ0f3j4mMGubIedbOWdLs9Y4/rPGAs=
7+
github.com/kaushalmodi/hugo-debugprint v0.1.0/go.mod h1:vusrDLlGE+4Uc1b4PgM0dI8lJCEqC1o7NjFr8WIfkaQ=
8+
github.com/kaushalmodi/hugo-jf2 v0.2.0 h1:/p5njKwFHpWlKLPtD7siISsac1bQzOgYzFvOaNuf2Yc=
9+
github.com/kaushalmodi/hugo-jf2 v0.2.0/go.mod h1:g2lfnXOKlV6iQ3X5a4tJBOLwMZRfbR32jdiq/nSSNPg=
10+
github.com/kaushalmodi/hugo-search-fuse-js v0.4.4 h1:zEnFYi9DYMoHLsMOf5QqXcQJnfEYGaNanqjnTjlJjto=
11+
github.com/kaushalmodi/hugo-search-fuse-js v0.4.4/go.mod h1:Wr6gbPat+KW6wReh/hDBykKIWn296FsEkuhojJvHHxw=
12+
github.com/krisk/Fuse v3.2.1+incompatible/go.mod h1:3moWv8rDjwoKic9nwiPLgZjldkbdTAbtzJHCu/Vsj4A=
13+
github.com/krisk/Fuse v7.0.0+incompatible h1:jVyg6No+Joc51Rn97QQYJZIpCxzd4ywACn/4+FKWjvo=
14+
github.com/krisk/Fuse v7.0.0+incompatible/go.mod h1:3moWv8rDjwoKic9nwiPLgZjldkbdTAbtzJHCu/Vsj4A=
15+
gitlab.com/kaushalmodi/hugo-theme-refined v0.14.5 h1:o8EhC9wzGMnSCKNmCqzrKc6PIM4DBCN8WjXvYSXjGbk=
16+
gitlab.com/kaushalmodi/hugo-theme-refined v0.14.5/go.mod h1:/neiFc1Liz+RMJKLYV+joZzV0/ZgJpe9wpH3Tzm8Sok=

hugo.toml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
baseURL = 'https://tcluri.github.io/'
2+
title = 'tcluri:$'
3+
4+
contentdir = "content"
5+
layoutdir = "layouts"
6+
publishdir = "public"
7+
8+
# Remove files from destination not found in static directories
9+
cleandestinationdir = true
10+
11+
enableEmoji = true
12+
13+
languageCode = 'en-us'
14+
15+
disableFastRender = true
16+
17+
[module]
18+
[[module.imports]]
19+
path = "gitlab.com/kaushalmodi/hugo-theme-refined"
20+
21+
[Author]
22+
name = "Tejaa Chintaluri"
23+
homepage = "https://tcluri.github.io/"
24+
25+
[Social]
26+
github = "tcluri"
27+
twitter = "tcluri_"
28+
29+
[Params]
30+
tagline = "My random notes"
31+
32+
# Go date formats: https://golang.org/pkg/time/#pkg-constants
33+
dateform = "Mon Jan 2, 2006"
34+
35+
# Set favicons to true only if the following files are present in the project assets/ dir:
36+
# - safari-pinned-tab.svg
37+
# - manifest.json
38+
# - favicon-16x16.png
39+
# - favicon-32x32.png
40+
# - apple-touch-icon.png
41+
favicons = false
42+
43+
themecolorbase = "blue" # Valid values: "red", "orange", "yellow", "green", "cyan", "blue", "magenta", "brown"
44+
45+
[Params.source]
46+
url = "https://github.com/tcluri/tcluri.github.io"
47+
48+
[[Params.social.service]]
49+
name = "Github"
50+
link = "https://github.com/tcluri/"
51+
relme = true
52+
[[Params.social.service]]
53+
name = "Twitter"
54+
link = "https://twitter.com/tcluri_/"
55+
56+
[markup]
57+
[markup.highlight]
58+
codeFences = true # default = true
59+
lineNumbersInTable = true
60+
[markup.goldmark]
61+
[markup.goldmark.renderer]
62+
unsafe = true

0 commit comments

Comments
 (0)