Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • asztrikx/linux-presentation
  • zoli0/linux-presentation
2 results
Show changes
Commits on Source (107)
image: kroniak/ssh-client
# image: kroniak/ssh-client
stages:
- generate
- build
- deploy
home:
variables:
CI_REGISTRY_IMAGE: ${CI_REGISTRY}/${CI_PROJECT_NAME}
KUBECONFIG_VAR_NAME: KUBECONFIG
# home:
# stage: deploy
# before_script:
# - eval $(ssh-agent -s)
# - echo "$SSH" | tr -d '\r' | ssh-add -
# - mkdir -p ~/.ssh/socket
# - chmod 700 ~/.ssh
# - cp .magic_ssh_config ~/.ssh/config
# script:
# # AFS magic incoming
# - ssh mikewashere@centaur.sch.bme.hu cp /afs/sch.bme.hu/home/mikewashere/.system/mikewashere.keytab /tmp/mikewashere.keytab
# - ssh mikewashere@centaur.sch.bme.hu kinit -k -t /tmp/mikewashere.keytab mikewashere
# - ssh mikewashere@centaur.sch.bme.hu rm /tmp/mikewashere.keytab
# - ssh mikewashere@centaur.sch.bme.hu aklog sch.bme.hu -k SCH.BME.HU
# - ssh mikewashere@centaur.sch.bme.hu mkdir -p /home/mikewashere/public_html/linux
# # actual work
# - scp -r $PWD/* mikewashere@centaur.sch.bme.hu:/home/mikewashere/public_html/linux/
# - ssh mikewashere@centaur.sch.bme.hu env sh -c 'echo lolwut; cd public_html/linux; bash cirun.sh'
# only:
# refs:
# - master
gen_pres:
stage: generate
image:
name: marpteam/marp-cli
entrypoint: [""]
script:
- alias marp="node /home/marp/.cli/marp-cli.js"
- cd eloadas
- marp -o index.html presentation.md
artifacts:
paths:
- eloadas/index.html
container:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
script:
- |
/kaniko/executor --context ${CI_PROJECT_DIR} \
--dockerfile ${CI_PROJECT_DIR}/Dockerfile \
--destination ${CI_REGISTRY_IMAGE}:latest
only:
- master
except:
- tags
kubernetes:
stage: deploy
image:
name: harbor.sch.bme.hu/kszk/kube-tools:latest
entrypoint: [""]
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh/socket
- chmod 700 ~/.ssh
- cp .magic_ssh_config ~/.ssh/config
- chmod 600 ${!KUBECONFIG_VAR_NAME}
- export KUBECONFIG=${!KUBECONFIG_VAR_NAME}
script:
- ssh mikewashere@centaur.sch.bme.hu bash -c "cp /afs/sch.bme.hu/home/mikewashere/.system/mikewashere.keytab /tmp/; kinit -k -t /tmp/mikewashere.keytab mikewashere; rm /tmp/mikewashere.keytab; aklog sch.bme.hu -k SCH.BME.HU"
- ssh mikewashere@centaur.sch.bme.hu mkdir -p ~/public_html/linux
- scp -R . mikewashere@centaur.sch.bme.hu:~/public_html/linux/.
- kubectl rollout restart deployment linux-presentation
only:
refs:
- master
\ No newline at end of file
- master
except:
- tags
......@@ -3,4 +3,6 @@ Host centaur.sch.bme.hu
ControlMaster auto
ControlPersist yes
ControlPath ~/.ssh/socket/%r@%h:%p
RequestTTY yes
\ No newline at end of file
KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr
HostKeyAlgorithms +ssh-rsa
FROM nginx:1.21.6
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY . /usr/share/nginx/html
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Linux presentation
Copyright (C) 2021 Miklós Tóth
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
# Hello world
\ No newline at end of file
# Üdv a Linuxos előadás segédletében
<p id="meme"></p>
## Kedvcsináló
<script>
if (
navigator.platform.indexOf("Linux") !== -1 &&
!(navigator.userAgent.indexOf("Android") !== -1)
) {
document.getElementById('meme').innerText = "And oh, btw, hello fellow Linux user!";
}
</script>
*Miért is jó nekem, ha tudok Linuxul?*
- A világ legelterjedtebb\* operációs rendszerét tudni fogod használni.
- Az interneten lévő szerverek [túlnyomó többsége](https://en.wikipedia.org/wiki/Usage_share_of_operating_systems#Public_servers_on_the_Internet) Linuxot használ
- Az Android is Linux alapú, így a telefonok [>70%-án](https://en.wikipedia.org/wiki/Usage_share_of_operating_systems#Mobile_devices) Linux fut
- A [top 500](https://en.wikipedia.org/wiki/Usage_share_of_operating_systems#Supercomputers) szuperszámítógép mind Linuxot futtat
- Mindenféle beágyazott cuccban megtalálható a Linux (autók, random gépek, stb)
- Sok itt megtanult tudást más operációs rendszereken is tudod hasznosítani
- A legtöbb nem Windows alapú OS UNIX-szerű<sup>(erről később lesz szó)</sup>, csakúgy mint a Linux,
így az előadásaink nagy része ugyanígy vonatkozik macOS-re és BSD-kre is
- A KSZK-s szolgáltatások többsége is Linuxon fut,
így szükséged lesz egy kis Linux tudásra akkor is, ha a DevTeam-ben
vagy HaT-ban szeretnél ügyeskedni, nem beszélve a SysAdmin-ról, NETeam-ről vagy SecurITeam-ről
*OK, meggyőztél. Miről is lesz szó?*
- UNIX-os dolgokról
- Terminálról, shellről
- A Linux alapvető felépítéséről
- Pár fontosabb parancsról
- Egy (web)szerver üzemeltetéséhez szükséges tudásról
## Jegyzet
- [Linux alapok](linux%20alapok.md)
- [Szerver kezelés](szerver%20kezelés.md)

,,╓╖æææφφæææ╖╖,,
,φΦ▓╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫▓Φæ┐
╓Φ▓╫╫╫╫╫╫╫╫▓╣╝╝╝╜╜╜╜╜╝╝╣▓╫╫╫╫╫╫╫╫╫Φ╖
,╖▓╫╫╫╫╫╫▌╜"` `"╜╣╫╫╫╫╫╫▓╗,
╓╣╫╫╫╫╫▌╜` `╙╣╫╫╫╫╫▓╖
╔▓╫╫╫╫▌┘ ╙╣╫╫╫╫╫╗
╓▓╫╫╫╫Å` `╝╫╫╫╫╫φ
,╣╫╫╫╫▀ ╝╫╫╫╫▓
╓╫╫╫╫▓^ `╣╫╫╫╫w
╓╫╫╫╫▌ ║╫╫╫╫N
╓╫╫╫╫▌ ╓╫╫▌ Φ▓Φ ║╫╫╫╫φ
.╫╫╫╫▌ ╫╫▓ ╣╫╫M ║╫╫╫╫∩
╣╫╫╫╫ ╢╫╫ ╓╫╫▌ ╫╫╫╫▓
.╫╫╫╫▀ ╓╫╫╛ .╫╫▓ ║╫╫╫╫L
║╫╫╫╫ ▓╫▌ ║╫╫╫@ ,,, ╣╫╫ ╫╫╫╫▌
╣╫╫╫╫ ╢╫╫ ,╖æ .╫╫╫▌ ,╗╣▓╫╫╫╫╫╫╫╡║╫╫Ñ ,ææ ╫╫╫╫╫
╣╫╫╫╫ ┌╫╫Γ,æ▓╫╝ ╣╫╫▓ '╝╝╝╜╢╫╫╫╫M,╫╫╫ ,φ▓╫▓┘ ╫╫╫╫╫
║╫╫╫╫ ▓╫╫▓╫╣╜ ╓╫╫╫╡ ╓╣╫╫╫▀ ▓╫╫▌╣╫╫▓┘ ╫╫╫╫▌
╘╫╫╫╫L ║╫╫╫╫╜ ,╫╫╫╫▓ ╓▓╫╫╫Å ║╫╫╫╫╫▌` ╣╫╫╫╫
╫╫╫╫▓ .╫╫╫╫╫φ ,▓╫▀╫╫╫φ ╗▓╫╫╫╝ ┌╫╫╫╫╫╫┐ ╓▓╫╫╫╫┘
╘╫╫╫╫φ ╣╫╫╛╚╫╫W,╓╬╫╫▓ ║╫╫╫ ╓▓╫╫╫▓╖╗╖┐ ▓╫╫▌║╫╫╫µ ,,,╖╗╣╫╫╫╫╫▌
╢╫╫╫╫┐ ┌╫╫M ╚▓╫╫╫▓╫╫╫╣╫╫▓ ╫╫╫╫╫╫╫╫╫▓┘║╫╫▌ ╣╫╫╫╫╫╫╫╫╫╫╫╫▓╜
╣╫╫╫╫┐ '╝` ╙╝╣╣╝ `╙╜╙"^` ╣╫▌ ╙╣╫╫╫╫▓▀╝╜`
╣╫╫╫╫W
╚╫╫╫╫▓,
`╣╫╫╫╫Φ,
╙▓╫╫╫╫▓w ┌╣▓╖
╙╣╫╫╫╫╫Φ, ,#▓╫╫╫╫▓
`╝╫╫╫╫╫╫▓╗, ,╖╣╫╫╫╫╫╫Å`
`╝▓╫╫╫╫╫╫╫▓φ╗╖,, ,,╓╖φ╣╫╫╫╫╫╫╫▓╝`
"╜╣╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫╫▓╝"
`╙╜╝╣▓╫╫╫╫╫╫╫╫╫╫▓╣╝╜╙`

According to all known laws of aviation, there is no way a bee should be able to fly.
Its wings are too small to get its fat little body off the ground.
The bee, of course, flies anyway because bees don't care what humans think is impossible.
Yellow, black. Yellow, black. Yellow, black. Yellow, black.
Ooh, black and yellow!
Let's shake it up a little.
Barry! Breakfast is ready!
Coming!
Hang on a second.
Hello?
Barry?
Adam?
Can you believe this is happening?
I can't.
I'll pick you up.
Looking sharp.
Use the stairs, Your father paid good money for those.
Sorry. I'm excited.
Here's the graduate.
We're very proud of you, son.
A perfect report card, all B's.
Very proud.
Ma! I got a thing going here.
You got lint on your fuzz.
Ow! That's me!
Wave to us! We'll be in row 118,000.
Bye!
Barry, I told you, stop flying in the house!
Hey, Adam.
Hey, Barry.
Is that fuzz gel?
A little. Special day, graduation.
Never thought I'd make it.
Three days grade school, three days high school.
Those were awkward.
Three days college. I'm glad I took a day and hitchhiked around The Hive.
You did come back different.
Hi, Barry. Artie, growing a mustache? Looks good.
Hear about Frankie?
Yeah.
You going to the funeral?
No, I'm not going.
Everybody knows, sting someone, you die.
Don't waste it on a squirrel.
Such a hothead.
I guess he could have just gotten out of the way.
I love this incorporating an amusement park into our day.
That's why we don't need vacations.
Boy, quite a bit of pomp under the circumstances.
Well, Adam, today we are men.
We are!
Bee-men.
Amen!
Hallelujah!
Students, faculty, distinguished bees,
please welcome Dean Buzzwell.
Welcome, New Hive City graduating class of 9:15.
That concludes our ceremonies And begins your career at Honex Industries!
Will we pick our job today?
I heard it's just orientation.
Heads up! Here we go.
Keep your hands and antennas inside the tram at all times.
Wonder what it'll be like?
A little scary.
Welcome to Honex, a division of Honesco and a part of the Hexagon Group.
This is it!
Wow.
Wow.
We know that you, as a bee, have worked your whole life to get to the point where you can work for your whole life.
Honey begins when our valiant Pollen Jocks bring the nectar to The Hive.
Our top-secret formula is automatically color-corrected, scent-adjusted and bubble-contoured into this soothing sweet syrup with its distinctive golden glow you know as... Honey!
That girl was hot.
She's my cousin!
She is?
Yes, we're all cousins.
Right. You're right.
At Honex, we constantly strive to improve every aspect of bee existence.
These bees are stress-testing a new helmet technology.
What do you think he makes?
Not enough.
Here we have our latest advancement, the Krelman.
What does that do?
Catches that little strand of honey that hangs after you pour it.
Saves us millions.
Can anyone work on the Krelman?
Of course. Most bee jobs are small ones.
But bees know that every small job, if it's done well, means a lot.
But choose carefully because you'll stay in the job you pick for the rest of your life.
The same job the rest of your life? I didn't know that.
What's the difference?
You'll be happy to know that bees, as a species, haven't had one day off in 27 million years.
So you'll just work us to death?
We'll sure try.
Wow! That blew my mind!
"What's the difference?"
How can you say that?
One job forever?
That's an insane choice to have to make.
I'm relieved. Now we only have to make one decision in life.
But, Adam, how could they never have told us that?
Why would you question anything? We're bees.
We're the most perfectly functioning society on Earth.
You ever think maybe things work a little too well here?
Like what? Give me one example.
I don't know. But you know what I'm talking about.
Please clear the gate. Royal Nectar Force on approach.
Wait a second. Check it out.
Hey, those are Pollen Jocks!
Wow.
I've never seen them this close.
They know what it's like outside The Hive.
Yeah, but some don't come back.
Hey, Jocks!
Hi, Jocks!
You guys did great!
You're monsters!
You're sky freaks! I love it! I love it!
I wonder where they were.
I don't know.
Their day's not planned.
Outside The Hive, flying who knows where, doing who knows what.
You can't just decide to be a Pollen Jock. You have to be bred for that.
Right.
Look. That's more pollen than you and I will see in a lifetime.
It's just a status symbol.
Bees make too much of it.
Perhaps. Unless you're wearing it and the ladies see you wearing it.
Those ladies?
Aren't they our cousins too?
Distant. Distant.
Look at these two.
Couple of Hive Harrys.
Let's have fun with them.
It must be dangerous being a Pollen Jock.
Yeah. Once a bear pinned me against a mushroom!
He had a paw on my throat, and with the other, he was slapping me!
Oh, my!
I never thought I'd knock him out.
What were you doing during this?
Trying to alert the authorities.
I can autograph that.
A little gusty out there today, wasn't it, comrades?
Yeah. Gusty.
We're hitting a sunflower patch six miles from here tomorrow.
Six miles, huh?
Barry!
A puddle jump for us, but maybe you're not up for it.
Maybe I am.
You are not!
We're going 0900 at J-Gate.
What do you think, buzzy-boy?
Are you bee enough?
I might be. It all depends on what 0900 means.
Hey, Honex!
Dad, you surprised me.
You decide what you're interested in?
Well, there's a lot of choices.
But you only get one.
Do you ever get bored doing the same job every day?
Son, let me tell you about stirring.
You grab that stick, and you just move it around, and you stir it around.
You get yourself into a rhythm.
It's a beautiful thing.
You know, Dad, the more I think about it,
maybe the honey field just isn't right for me.
You were thinking of what, making balloon animals?
That's a bad job for a guy with a stinger.
Janet, your son's not sure he wants to go into honey!
Barry, you are so funny sometimes.
I'm not trying to be funny.
You're not funny! You're going into honey. Our son, the stirrer!
You're gonna be a stirrer?
No one's listening to me!
Wait till you see the sticks I have.
I could say anything right now.
I'm gonna get an ant tattoo!
Let's open some honey and celebrate!
Maybe I'll pierce my thorax. Shave my antennae. Shack up with a grasshopper. Get a gold tooth and call everybody "dawg"!
I'm so proud.
We're starting work today!
Today's the day.
Come on! All the good jobs will be gone.
Yeah, right.
Pollen counting, stunt bee, pouring, stirrer, front desk, hair removal...
Is it still available?
Hang on. Two left!
One of them's yours! Congratulations!
Step to the side.
What'd you get?
Picking crud out. Stellar!
Wow!
Couple of newbies?
Yes, sir! Our first day! We are ready!
Make your choice.
You want to go first?
No, you go.
Oh, my. What's available?
Restroom attendant's open, not for the reason you think.
Any chance of getting the Krelman?
Sure, you're on.
I'm sorry, the Krelman just closed out.
Wax monkey's always open.
The Krelman opened up again.
What happened?
A bee died. Makes an opening. See? He's dead. Another dead one.
Deady. Deadified. Two more dead.
Dead from the neck up. Dead from the neck down. That's life!
Oh, this is so hard!
Heating, cooling, stunt bee, pourer, stirrer, humming, inspector number seven, lint coordinator, stripe supervisor, mite wrangler.
Barry, what do you think I should... Barry?
Barry!
All right, we've got the sunflower patch in quadrant nine...
What happened to you?
Where are you?
I'm going out.
Out? Out where?
Out there.
Oh, no!
I have to, before I go to work for the rest of my life.
You're gonna die! You're crazy! Hello?
Another call coming in.
If anyone's feeling brave, there's a Korean deli on 83rd that gets their roses today.
Hey, guys.
Look at that.
Isn't that the kid we saw yesterday?
Hold it, son, flight deck's restricted.
It's OK, Lou. We're gonna take him up.
Really? Feeling lucky, are you?
Sign here, here. Just initial that.
Thank you.
OK.
You got a rain advisory today, and as you all know, bees cannot fly in rain.
So be careful. As always, watch your brooms, hockey sticks, dogs, birds, bears and bats.
Also, I got a couple of reports of root beer being poured on us.
Murphy's in a home because of it, babbling like a cicada!
That's awful.
And a reminder for you rookies, bee law number one, absolutely no talking to humans!
All right, launch positions!
Buzz, buzz, buzz, buzz! Buzz, buzz, buzz, buzz! Buzz, buzz, buzz, buzz!
Black and yellow!
Hello!
You ready for this, hot shot?
Yeah. Yeah, bring it on.
Wind, check.
Antennae, check.
Nectar pack, check.
Wings, check.
Stinger, check.
Scared out of my shorts, check.
OK, ladies,
let's move it out!
Pound those petunias, you striped stem-suckers!
All of you, drain those flowers!
Wow! I'm out!
I can't believe I'm out!
So blue.
I feel so fast and free!
Box kite!
Wow!
Flowers!
This is Blue Leader, We have roses visual.
Bring it around 30 degrees and hold.
Roses!
30 degrees, roger. Bringing it around.
Stand to the side, kid.
It's got a bit of a kick.
That is one nectar collector!
Ever see pollination up close?
No, sir.
I pick up some pollen here, sprinkle it over here. Maybe a dash over there, a pinch on that one.
See that? It's a little bit of magic.
That's amazing. Why do we do that?
That's pollen power. More pollen, more flowers, more nectar, more honey for us.
Cool.
I'm picking up a lot of bright yellow, Could be daisies, Don't we need those?
Copy that visual.
Wait. One of these flowers seems to be on the move.
Say again? You're reporting a moving flower?
Affirmative.
That was on the line!
This is the coolest. What is it?
I don't know, but I'm loving this color.
It smells good.
Not like a flower, but I like it.
Yeah, fuzzy.
Chemical-y.
Careful, guys. It's a little grabby.
My sweet lord of bees!
Candy-brain, get off there!
Problem!
Guys!
This could be bad.
Affirmative.
Very close.
Gonna hurt.
Mama's little boy.
You are way out of position, rookie!
Coming in at you like a missile!
Help me!
I don't think these are flowers.
Should we tell him?
I think he knows.
What is this?!
Match point!
You can start packing up, honey, because you're about to eat it!
Yowser!
Gross.
There's a bee in the car!
Do something!
I'm driving!
Hi, bee.
He's back here!
He's going to sting me!
Nobody move. If you don't move, he won't sting you. Freeze!
He blinked!
Spray him, Granny!
What are you doing?!
Wow... the tension level out here is unbelievable.
I gotta get home.
Can't fly in rain. Can't fly in rain. Can't fly in rain.
Mayday! Mayday! Bee going down!
Ken, could you close the window please?
Ken, could you close the window please?
Check out my new resume. I made it into a fold-out brochure. You see? Folds out.
Oh, no. More humans. I don't need this.
What was that?
Maybe this time. This time. This time. This time! This time! This... Drapes!
That is diabolical.
It's fantastic. It's got all my special skills, even my top-ten favorite movies.
What's number one? Star Wars?
Nah, I don't go for that... kind of stuff.
No wonder we shouldn't talk to them. They're out of their minds.
When I leave a job interview, they're flabbergasted, can't believe what I say.
There's the sun. Maybe that's a way out.
I don't remember the sun having a big 75 on it.
I predicted global warming. I could feel it getting hotter. At first I thought it was just me.
Wait! Stop! Bee!
Stand back. These are winter boots.
Wait!
Don't kill him!
You know I'm allergic to them! This thing could kill me!
Why does his life have less value than yours?
Why does his life have any less value than mine? Is that your statement?
I'm just saying all life has value. You don't know what he's capable of feeling.
My brochure!
There you go, little guy.
I'm not scared of him.It's an allergic thing.
Put that on your resume brochure.
My whole face could puff up.
Make it one of your special skills.
Knocking someone out is also a special skill.
Right. Bye, Vanessa. Thanks.
Vanessa, next week? Yogurt night?
Sure, Ken. You know, whatever.
You could put carob chips on there.
Bye.
Supposed to be less calories.
Bye.
I gotta say something. She saved my life. I gotta say something.
All right, here it goes.
Nah.
What would I say?
I could really get in trouble. It's a bee law. You're not supposed to talk to a human.
I can't believe I'm doing this. I've got to.
Oh, I can't do it. Come on!
No. Yes. No. Do it. I can't.
How should I start it? "You like jazz?" No, that's no good.
Here she comes! Speak, you fool!
Hi!
I'm sorry. You're talking.
Yes, I know.
You're talking!
I'm so sorry.
No, it's OK. It's fine.
I know I'm dreaming. But I don't recall going to bed.
Well, I'm sure this is very disconcerting.
This is a bit of a surprise to me. I mean, you're a bee!
I am. And I'm not supposed to be doing this, but they were all trying to kill me.
And if it wasn't for you... I had to thank you. It's just how I was raised.
That was a little weird. I'm talking with a bee.
Yeah.
I'm talking to a bee. And the bee is talking to me!
I just want to say I'm grateful.
I'll leave now.
Wait! How did you learn to do that?
What?
The talking thing.
Same way you did, I guess. "Mama, Dada, honey." You pick it up.
That's very funny.
Yeah.
Bees are funny. If we didn't laugh, we'd cry with what we have to deal with.
Anyway... Can I... get you something?
Like what?
I don't know. I mean... I don't know. Coffee?
I don't want to put you out.
It's no trouble. It takes two minutes.
It's just coffee.
I hate to impose.
Don't be ridiculous!
Actually, I would love a cup.
Hey, you want rum cake?
I shouldn't.
Have some.
No, I can't.
Come on!
I'm trying to lose a couple micrograms.
Where?
These stripes don't help.
You look great!
I don't know if you know anything about fashion.
Are you all right?
No.
He's making the tie in the cab as they're flying up Madison.
He finally gets there.
He runs up the steps into the church.
The wedding is on.
And he says, "Watermelon?
I thought you said Guatemalan.
Why would I marry a watermelon?"
Is that a bee joke?
That's the kind of stuff we do.
Yeah, different.
So, what are you gonna do, Barry?
About work? I don't know.
I want to do my part for The Hive, but I can't do it the way they want.
I know how you feel.
You do?
Sure.
My parents wanted me to be a lawyer or a doctor, but I wanted to be a florist.
Really?
My only interest is flowers.
Our new queen was just elected with that same campaign slogan.
Anyway, if you look... There's my hive right there. See it?
You're in Sheep Meadow!
Yes! I'm right off the Turtle Pond!
No way! I know that area. I lost a toe ring there once.
Why do girls put rings on their toes?
Why not?
It's like putting a hat on your knee.
Maybe I'll try that.
You all right, ma'am?
Oh, yeah. Fine.
Just having two cups of coffee!
Anyway, this has been great.
Thanks for the coffee.
Yeah, it's no trouble.
Sorry I couldn't finish it. If I did, I'd be up the rest of my life.
Are you...?
Can I take a piece of this with me?
Sure! Here, have a crumb.
Thanks!
Yeah.
All right. Well, then... I guess I'll see you around. Or not.
OK, Barry.
And thank you so much again... for before.
Oh, that? That was nothing.
Well, not nothing, but... Anyway...
This can't possibly work.
He's all set to go.
We may as well try it.
OK, Dave, pull the chute.
Sounds amazing.
It was amazing!
It was the scariest, happiest moment of my life.
Humans! I can't believe you were with humans!
Giant, scary humans!
What were they like?
Huge and crazy. They talk crazy.
They eat crazy giant things.
They drive crazy.
Do they try and kill you, like on TV?
Some of them. But some of them don't.
How'd you get back?
Poodle.
You did it, and I'm glad. You saw whatever you wanted to see.
You had your "experience." Now you can pick out yourjob and be normal.
Well...
Well?
Well, I met someone.
You did? Was she Bee-ish?
A wasp?! Your parents will kill you!
No, no, no, not a wasp.
Spider?
I'm not attracted to spiders.
I know it's the hottest thing, with the eight legs and all. I can't get by that face.
So who is she?
She's... human.
No, no. That's a bee law. You wouldn't break a bee law.
Her name's Vanessa.
Oh, boy.
She's so nice. And she's a florist!
Oh, no! You're dating a human florist!
We're not dating.
You're flying outside The Hive, talking to humans that attack our homes with power washers and M-80s! One-eighth a stick of dynamite!
She saved my life! And she understands me.
This is over!
Eat this.
This is not over! What was that?
They call it a crumb.
It was so stingin' stripey!
And that's not what they eat.
That's what falls off what they eat!
You know what a Cinnabon is?
No.
It's bread and cinnamon and frosting. They heat it up...
Sit down!
...really hot!
Listen to me!
We are not them! We're us.
There's us and there's them!
Yes, but who can deny the heart that is yearning?
There's no yearning. Stop yearning. Listen to me!
You have got to start thinking bee, my friend. Thinking bee!
Thinking bee.
Thinking bee.
Thinking bee! Thinking bee! Thinking bee! Thinking bee!
There he is. He's in the pool.
You know what your problem is, Barry?
I gotta start thinking bee?
How much longer will this go on?
It's been three days! Why aren't you working?
I've got a lot of big life decisions to think about.
What life? You have no life!
You have no job. You're barely a bee!
Would it kill you to make a little honey?
Barry, come out. Your father's talking to you.
Martin, would you talk to him?
Barry, I'm talking to you!
You coming?
Got everything?
All set!
Go ahead. I'll catch up.
Don't be too long.
Watch this!
Vanessa!
We're still here.
I told you not to yell at him.
He doesn't respond to yelling!
Then why yell at me?
Because you don't listen!
I'm not listening to this.
Sorry, I've gotta go.
Where are you going?
I'm meeting a friend.
A girl? Is this why you can't decide?
Bye.
I just hope she's Bee-ish.
They have a huge parade of flowers every year in Pasadena?
To be in the Tournament of Roses, that's every florist's dream!
Up on a float, surrounded by flowers, crowds cheering.
A tournament. Do the roses compete in athletic events?
No. All right, I've got one.
How come you don't fly everywhere?
It's exhausting. Why don't you run everywhere? It's faster.
Yeah, OK, I see, I see.
All right, your turn.
TiVo. You can just freeze live TV? That's insane!
You don't have that?
We have Hivo, but it's a disease. It's a horrible, horrible disease.
Oh, my.
Dumb bees!
You must want to sting all those jerks.
We try not to sting. It's usually fatal for us.
So you have to watch your temper.
Very carefully.
You kick a wall, take a walk, write an angry letter and throw it out. Work through it like any emotion: Anger, jealousy, lust.
Oh, my goodness! Are you OK?
Yeah.
What is wrong with you?!
It's a bug.
He's not bothering anybody.
Get out of here, you creep!
What was that? A Pic 'N' Save circular?
Yeah, it was. How did you know?
It felt like about 10 pages. Seventy-five is pretty much our limit.
You've really got that down to a science.
I lost a cousin to Italian Vogue.
I'll bet.
What in the name of Mighty Hercules is this?
How did this get here? cute Bee, Golden Blossom, Ray Liotta Private Select?
Is he that actor?
I never heard of him.
Why is this here?
For people. We eat it.
You don't have enough food of your own?
Well, yes.
How do you get it?
Bees make it.
I know who makes it! And it's hard to make it!
There's heating, cooling, stirring. You need a whole Krelman thing!
It's organic.
It's our-ganic!
It's just honey, Barry.
Just what?!
Bees don't know about this! This is stealing! A lot of stealing!
You've taken our homes, schools,hospitals! This is all we have!
And it's on sale?! I'm getting to the bottom of this.
I'm getting to the bottom of all of this!
Hey, Hector. You almost done?
Almost.
He is here. I sense it.
Well, I guess I'll go home now and just leave this nice honey out, with no one around.
You're busted, box boy!
I knew I heard something.
So you can talk!
I can talk. And now you'll start talking!
Where you getting the sweet stuff? Who's your supplier?
I don't understand.
I thought we were friends.
The last thing we want to do is upset bees!
You're too late! It's ours now!
You, sir, have crossed the wrong sword!
You, sir, will be lunch for my iguana, Ignacio!
Where is the honey coming from? Tell me where!
Honey Farms! It comes from Honey Farms!
Crazy person!
What horrible thing has happened here?
These faces, they never knew what hit them. And now
they're on the road to nowhere!
Just keep still.
What? You're not dead?
Do I look dead? They will wipe anything that moves. Where you headed?
To Honey Farms. I am onto something huge here.
I'm going to Alaska. Moose blood, crazy stuff. Blows your head off!
I'm going to Tacoma.
And you?
He really is dead.
All right.
Uh-oh!
What is that?!
Oh, no!
A wiper! Triple blade!
Triple blade?
Jump on! It's your only chance, bee!
Why does everything have
to be so doggone clean?!
How much do you people need to see?!
Open your eyes!
Stick your head out the window!
From NPR News in Washington,
I'm Carl Kasell.
But don't kill no more bugs!
Bee!
Moose blood guy!!
You hear something?
Like what?
Like tiny screaming.
Turn off the radio.
Whassup, bee boy?
Hey, Blood.
Just a row of honey jars, as far as the eye could see.
Wow!
I assume wherever this truck goes is where they're getting it. I mean, that honey's ours.
Bees hang tight. We're all jammed in.
It's a close community.
Not us, man. We on our own. Every mosquito on his own.
What if you get in trouble?
You a mosquito, you in trouble. Nobody likes us. They just smack. See a mosquito, smack, smack!
At least you're out in the world. You must meet girls.
Mosquito girls try to trade up, get with a moth, dragonfly. Mosquito girl don't want no mosquito.
You got to be kidding me!
Mooseblood's about to leave the building! So long, bee!
Hey, guys!
Mooseblood!
I knew I'd catch y'all down here.
Did you bring your crazy straw?
We throw it in jars, slap a label on it, and it's pretty much pure profit.
What is this place?
A bee's got a brain the size of a pinhead.
They are pinheads!
Pinhead.
Check out the new smoker.
Oh, sweet. That's the one you want. The Thomas 3000!
Smoker?
Ninety puffs a minute, semi-automatic. Twice the nicotine, all the tar. A couple breaths of this knocks them right out.
They make the honey, and we make the money.
"They make the honey, and we make the money"?
Oh, my!
What's going on? Are you OK?
Yeah. It doesn't last too long.
Do you know you're in a fake hive with fake walls?
Our queen was moved here. We had no choice.
This is your queen? That's a man in women's clothes! That's a drag queen!
What is this?
Oh, no!
There's hundreds of them!
Bee honey.
Our honey is being brazenly stolen on a massive scale!
This is worse than anything bears have done! I intend to do something.
Oh, Barry, stop.
Who told you humans are taking our honey? That's a rumor.
Do these look like rumors?
That's a conspiracy theory. These are obviously doctored photos. How did you get mixed up in this?
He's been talking to humans.
What? Talking to humans?!
He has a human girlfriend. And they make out!
Make out? Barry!
We do not.
You wish you could.
Whose side are you on?
The bees!
I dated a cricket once in San Antonio. Those crazy legs kept me up all night.
Barry, this is what you want to do with your life?
I want to do it for all our lives. Nobody works harder than bees!
Dad, I remember you coming home so overworked
your hands were still stirring. You couldn't stop.
I remember that.
What right do they have to our honey?
We live on two cups a year. They put it in lip balm for no reason whatsoever!
Even if it's true, what can one bee do?
Sting them where it really hurts.
In the face! The eye!
That would hurt.
No.
Up the nose? That's a killer.
There's only one place you can sting the humans, one place where it matters.
Hive at Five, The Hive's only full-hour action news source.
No more bee beards!
With Bob Bumble at the anchor desk. Weather with Storm Stinger. Sports with Buzz Larvi. And Jeanette Chung.
Good evening. I'm Bob Bumble.
And I'm Jeanette Ohung.
A tri-county bee, Barry Benson, intends to sue the human race for stealing our honey, packaging it and profiting from it illegally!
Tomorrow night on Bee Larry King, we'll have three former queens here in our studio, discussing their new book, classy Ladies, out this week on Hexagon.
Tonight we're talking to Barry Benson.
Did you ever think, "I'm a kid from The Hive. I can't do this"?
Bees have never been afraid to change the world.
What about Bee Oolumbus? Bee Gandhi? Bejesus?
Where I'm from, we'd never sue humans.
We were thinking of stickball or candy stores.
How old are you?
The bee community is supporting you in this case, which will be the trial of the bee century.
You know, they have a Larry King in the human world too.
It's a common name. Next week...
He looks like you and has a show and suspenders and colored dots...
Next week...
Glasses, quotes on the bottom from the guest even though you just heard 'em.
Bear Week next week! They're scary, hairy and here live.
Always leans forward, pointy shoulders, squinty eyes, very Jewish.
In tennis, you attack at the point of weakness!
It was my grandmother, Ken. She's 81.
Honey, her backhand's a joke!
I'm not gonna take advantage of that?
Quiet, please.
Actual work going on here.
Is that that same bee?
Yes, it is!
I'm helping him sue the human race.
Hello.
Hello, bee.
This is Ken.
Yeah, I remember you. Timberland, size ten and a half. Vibram sole, I believe.
Why does he talk again?
Listen, you better go 'cause we're really busy working.
But it's our yogurt night!
Bye-bye.
Why is yogurt night so difficult?!
You poor thing. You two have been at this for hours!
Yes, and Adam here has been a huge help.
Frosting...
How many sugars?
Just one. I try not to use the competition.
So why are you helping me?
Bees have good qualities. And it takes my mind off the shop. Instead of flowers, people are giving balloon bouquets now.
Those are great, if you're three.
And artificial flowers.
Oh, those just get me psychotic!
Yeah, me too.
Bent stingers, pointless pollination.
Bees must hate those fake things!
Nothing worse than a daffodil that's had work done.
Maybe this could make up for it a little bit.
This lawsuit's a pretty big deal.
I guess.
You sure you want to go through with it?
Am I sure? When I'm done with the humans, they won't be able to say, "Honey, I'm home," without paying a royalty!
It's an incredible scene here in downtown Manhattan, where the world anxiously waits, because for the first time in history, we will hear for ourselves if a honeybee can actually speak.
What have we gotten into here, Barry?
It's pretty big, isn't it?
I can't believe how many humans don't work during the day.
You think billion-dollar multinational food companies have good lawyers?
Everybody needs to stay behind the barricade.
What's the matter?
I don't know, I just got a chill.
Well, if it isn't the bee team.
You boys work on this?
All rise! The Honorable Judge Bumbleton presiding.
All right. Case number 4475,
Superior Court of New York,
Barry Bee Benson v. the Honey Industry is now in session.
Mr. Montgomery, you're representing the five food companies collectively?
A privilege.
Mr. Benson... you're representing all the bees of the world?
I'm kidding. Yes, Your Honor, we're ready to proceed.
Mr. Montgomery, your opening statement, please.
Ladies and gentlemen of the jury, my grandmother was a simple woman. Born on a farm, she believed it was man's divine right to benefit from the bounty of nature God put before us.
If we lived in the topsy-turvy world Mr. Benson imagines, just think of what would it mean.
I would have to negotiate with the silkworm for the elastic in my britches!
Talking bee!
How do we know this isn't some sort of holographic motion-picture-capture Hollywood wizardry?
They could be using laser beams! Robotics! Ventriloquism! Cloning! For all we know, he could be on steroids!
Mr. Benson?
Ladies and gentlemen, there's no trickery here. I'm just an ordinary bee. Honey's pretty important to me. It's important to all bees. We invented it! We make it. And we protect it with our lives.
Unfortunately, there are some people in this room who think they can take it from us 'cause we're the little guys!
I'm hoping that, after this is all over, you'll see how, by taking our honey, you not only take everything we have but everything we are!
I wish he'd dress like that all the time. So nice!
Call your first witness.
So, Mr. Klauss Vanderhayden of Honey Farms, big company you have.
I suppose so.
I see you also own Honeyburton and Honron!
Yes, they provide beekeepers for our farms.
Beekeeper. I find that to be a very disturbing term.
I don't imagine you employ any bee-free-ers, do you?
No.
I couldn't hear you.
No.
No. Because you don't free bees. You keep bees. Not only that, it seems you thought a bear would be an appropriate image for a jar of honey.
They're very lovable creatures. Yogi Bear, Fozzie Bear, Build-A-Bear.
You mean like this?
Bears kill bees!
How'd you like his head crashing through your living room?! Biting into your couch! Spitting out your throw pillows! OK, that's enough. Take him away.
So, Mr. Sting, thank you for being here. Your name intrigues me. Where have I heard it before?
I was with a band called The Police.
But you've never been a police officer, have you?
No, I haven't.
No, you haven't. And so here we have yet another example of bee culture casually stolen by a human for nothing more than a prance-about stage name.
Oh, please.
Have you ever been stung, Mr. Sting? Because I'm feeling a little stung, Sting. Or should I say... Mr. Gordon M. Sumner!
That's not his real name?! You idiots!
Mr. Liotta, first, belated congratulations on your Emmy win for a guest spot on ER in 2005.
Thank you. Thank you.
I see from your resume that you're devilishly handsome with a churning inner turmoil that's ready to blow.
I enjoy what I do. Is that a crime?
Not yet it isn't. But is this what it's come to for you? Exploiting tiny, helpless bees so you don't have to rehearse your part and learn your lines, sir?
Watch it, Benson! I could blow right now!
This isn't a goodfella.
This is a badfella!
Why doesn't someone just step on this creep, and we can all go home?!
Order in this court!
You're all thinking it!
Order! Order, I say!
Say it!
Mr. Liotta, please sit down!
I think it was awfully nice of that bear to pitch in like that. I think the jury's on our side.
Are we doing everything right, legally?
I'm a florist.
Right. Well, here's to a great team.
To a great team!
Well, hello.
Ken!
Hello.
I didn't think you were coming.
No, I was just late I tried to call, but... the battery.
I didn't want all this to go to waste,
so I called Barry. Luckily, he was free.
Oh, that was lucky.
There's a little left. I could heat it up.
Yeah, heat it up, sure, whatever.
So I hear you're quite a tennis player. I'm not much for the game myself. The ball's a little grabby.
That's where I usually sit. Right... there.
Ken, Barry was looking at your resume, and he agreed with me that eating with chopsticks isn't really a special skill.
You think I don't see what you're doing?
I know how hard it is to find the right job. We have that in common.
Do we?
Bees have 100 percent employment, but we do jobs like taking the crud out.
That's just what I was thinking about doing.
Ken, I let Barry borrow your razor for his fuzz. I hope that was all right.
I'm going to drain the old stinger.
Yeah, you do that.
Look at that.
You know, I've just about had it with your little Mind Games.
What's that?
Italian Vogue.
Mamma mia, that's a lot of pages.
A lot of ads.
Remember what Van said, why is your life more valuable than mine?
Funny, I just can't seem to recall that! I think something stinks in here!
I love the smell of flowers.
How do you like the smell of flames?!
Not as much.
Water bug! Not taking sides!
Ken, I'm wearing a Chapstick hat!
This is pathetic!
I've got issues!
Well, well, well, a royal flush!
You're bluffing.
Am I?
Surf's up, dude!
Poo water!
That bowl is gnarly. Except for those dirty yellow rings!
Kenneth! What are you doing?!
You know, I don't even like honey! I don't eat it!
We need to talk! He's just a little bee!
And he happens to be the nicest bee I've met in a long time!
Long time? What are you talking about?! Are there other bugs in your life?
No, but there are other things bugging me in life. And you're one of them!
Fine! Talking bees, no yogurt night...
My nerves are fried from riding on this emotional roller coaster!
Goodbye, Ken.
And for your information, I prefer sugar-free, artificial sweeteners made by man!
I'm sorry about all that.
I know it's got an aftertaste! I like it!
I always felt there was some kind of barrier between Ken and me. I couldn't overcome it.
Oh, well.
Are you OK for the trial?
I believe Mr. Montgomery is about out of ideas.
We would like to call Mr. Barry Benson Bee to the stand.
Good idea! You can really see why he's considered one of the best lawyers...
Yeah.
Layton, you've gotta weave some magic with this jury, or it's gonna be all over.
Don't worry. The only thing I have to do to turn this jury around is to remind them of what they don't like about bees.
You got the tweezers?
Are you allergic?
Only to losing, son. Only to losing.
Mr. Benson Bee, I'll ask you what I think we'd all like to know.
What exactly is your relationship to that woman?
We're friends.
Good friends?
Yes.
How good? Do you live together?
Wait a minute... Are you her little... bedbug?
I've seen a bee documentary or two. From what I understand, doesn't your queen give birth to all the bee children?
Yeah, but...
So those aren't your real parents!
Oh, Barry...
Yes, they are!
Hold me back!
You're an illegitimate bee, aren't you, Benson?
He's denouncing bees!
Don't y'all date your cousins?
Objection!
I'm going to pincushion this guy!
Adam, don't! It's what he wants!
Oh, I'm hit!! Oh, lordy, I am hit!
Order! Order!
The venom! The venom is coursing through my veins! I have been felled by a winged beast of destruction! You see? You can't treat them like equals! They're striped savages! Stinging's the only thing they know! It's their way!
Adam, stay with me.
I can't feel my legs.
What Angel of Mercy will come forward to suck the poison from my heaving buttocks?
I will have order in this court. Order! Order, please!
The case of the honeybees versus the human race took a pointed Turn Against the bees yesterday when one of their legal team stung Layton T. Montgomery.
Hey, buddy.
Hey.
Is there much pain?
Yeah.
I... I blew the whole case, didn't I?
It doesn't matter. What matters is
you're alive. You could have died.
I'd be better off dead. Look at me.
They got it from the cafeteria downstairs, in a tuna sandwich. Look, there's a little celery still on it.
What was it like to sting someone?
I can't explain it. It was all... All adrenaline and then...and then ecstasy!
All right.
You think it was all a trap?
Of course. I'm sorry. I flew us right into this.
What were we thinking? Look at us. We're just a couple of bugs in this world.
What will the humans do to us if they win?
I don't know.
I hear they put the roaches in motels. That doesn't sound so bad.
Adam, they check in, but they don't check out!
Oh, my.
Could you get a nurse to close that window?
Why?
The smoke.
Bees don't smoke.
Right. Bees don't smoke.
Bees don't smoke!
But some bees are smoking.
That's it! That's our case!
It is? It's not over?
Get dressed. I've gotta go somewhere.
Get back to the court and stall. Stall any way you can.
And assuming you've done step correctly, you're ready for the tub.
Mr. Flayman.
Yes? Yes, Your Honor!
Where is the rest of your team?
Well, Your Honor, it's interesting. Bees are trained to fly haphazardly, and as a result, we don't make very good time.
I actually heard a funny story about...
Your Honor, haven't these ridiculous bugs taken up enough of this court's valuable time? How much longer will we allow these absurd shenanigans to go on?
They have presented no compelling evidence to support their charges against my clients, who run legitimate businesses.
I move for a complete dismissal of this entire case!
Mr. Flayman, I'm afraid I'm going to have to consider Mr. Montgomery's motion.
But you can't! We have a terrific case.
Where is your proof?
Where is the evidence?
Show me the smoking gun!
Hold it, Your Honor!
You want a smoking gun? Here is your smoking gun.
What is that?
It's a bee smoker!
What, this? This harmless little contraption? This couldn't hurt a fly, let alone a bee.
Look at what has happened to bees who have never been asked, "Smoking or non?" Is this what nature intended for us? To be forcibly addicted to smoke machines and man-made wooden slat work camps?
Living out our lives as honey slaves to the white man?
What are we gonna do?
He's playing the species card.
Ladies and gentlemen, please, free these bees!
Free the bees! Free the bees! Free the bees! Free the bees! Free the bees!
The court finds in favor of the bees!
Vanessa, we won!
I knew you could do it! High-five!
Sorry.
I'm OK! You know what this means?
All the honey will finally belong to the bees.
Now we won't have to work so hard all the time.
This is an unholy perversion of the balance of nature, Benson.
You'll regret this.
Barry, how much honey is out there?
All right. One at a time.
Barry, who are you wearing?
My sweater is Ralph Lauren, and I have no pants.
What if Montgomery's right?
What do you mean?
We've been living the bee way a long time, 27 million years.
Congratulations on your victory. What will you demand as a settlement?
First, we'll demand a complete shutdown of all bee work camps.
Then we want back the honey that was ours to begin with, every last drop.
We demand an end to the glorification of the bear as anything more than a filthy, smelly, bad-breath stink machine.
We're all aware of what they do in the woods.
Wait for my signal. Take him out.
He'll have nauseous for a few hours, then he'll be fine.
And we will no longer tolerate bee-negative nicknames...
But it's just a prance-about stage name!
...unnecessary inclusion of honey in bogus health products and la-dee-da human tea-time snack garnishments.
Can't breathe.
Bring it in, boys!
Hold it right there! Good.
Tap it.
Mr. Buzzwell, we just passed three cups and there's gallons more coming!
I think we need to shut down!
Shut down? We've never shut down.
Shut down honey production!
Stop making honey!
Turn your key, sir!
What do we do now?
Cannonball!
We're shutting honey production!
Mission abort.
Aborting pollination and nectar detail.
Returning to base.
Adam, you wouldn't believe how much honey was out there.
Oh, yeah?
What's going on? Where is everybody?
Are they out celebrating?
They're home.
They don't know what to do. Laying out, sleeping in.
I heard your Uncle Carl was on his way to San Antonio with a cricket.
At least we got our honey back.
Sometimes I think, so what if humans liked our honey? Who wouldn't?
It's the greatest thing in the world! I was excited to be part of making it.
This was my new desk. This was my new job. I wanted to do it really well. And now...
Now I can't.
I don't understand why they're not happy.
I thought their lives would be better!
They're doing nothing. It's amazing.
Honey really changes people.
You don't have any idea what's going on, do you?
What did you want to show me?
This.
What happened here?
That is not the half of it.
Oh, no. Oh, my.
They're all wilting.
Doesn't look very good, does it?
No.
And whose fault do you think that is?
You know, I'm gonna guess bees.
Bees?
Specifically, me.
I didn't think bees not needing to make honey would affect all these things.
It's not just flowers. Fruits, vegetables, they all need bees.
That's our whole SAT test right there.
Take away produce, that affects the entire animal kingdom.
And then, of course...
The human species?
So if there's no more pollination, it could all just go south here, couldn't it?
I know this is also partly my fault.
How about a suicide pact?
How do we do it?
I'll sting you, you step on me.
That just kills you twice.
Right, right.
Listen, Barry... sorry, but I gotta get going.
I had to open my mouth and talk.
Vanessa?
Vanessa? Why are you leaving?
Where are you going?
To the final Tournament of Roses parade in Pasadena.
They've moved it to this weekend because all the flowers are dying.
It's the Last Chance I'll ever have to see it.
Vanessa, I just wanna say I'm sorry.
I never meant it to turn out like this.
I know. Me neither.
Tournament of Roses.
Roses can't do sports.
Wait a minute. Roses. Roses?
Roses!
Vanessa!
Roses?!
Barry?
Roses are flowers!
Yes, they are.
Flowers, bees, pollen!
I know.
That's why this is the last parade.
Maybe not.
Could you ask him to slow down?
Could you slow down?
Barry!
OK, I made a huge mistake.
This is a total disaster, all my fault.
Yes, it kind of is.
I've ruined the planet. I wanted to help you with the flower shop. I've made it worse.
Actually, it's completely closed down.
I thought maybe you were remodeling.
But I have another idea, and it's greater than my previous ideas combined.
I don't want to hear it!
All right, they have the roses, the roses have the pollen.
I know every bee, plant and flower bud in this park.
All we gotta do is get what they've got back here with what we've got.
Bees.
Park.
Pollen!
Flowers.
Repollination!
Across the nation!
Tournament of Roses, Pasadena, California.
They've got nothing but flowers, floats and cotton candy.
Security will be tight.
I have an idea.
Vanessa Bloome, FTD.
Official floral business. It's real.
Sorry, ma'am. Nice brooch.
Thank you. It was a gift.
Once inside, we just pick the right float.
How about The Princess and the Pea?
I could be the princess, and you could be the pea!
Yes, I got it.
Where should I sit?
What are you?
I believe I'm the pea.
The pea?
It goes under the mattresses.
Not in this fairy tale, sweetheart.
I'm getting the marshal.
You do that! This whole parade is a fiasco!
Let's see what this baby'll do.
Hey, what are you doing?!
Then all we do is blend in with traffic... without arousing suspicion.
Once at the airport, there's no stopping us.
Stop! Security.
You and your insect pack your float?
Yes.
Has it been in your possession the entire time?
Would you remove your shoes?
Remove your stinger.
It's part of me.
I know. Just having some fun.
Enjoy your flight.
Then if we're lucky, we'll have just enough pollen to do the job.
Can you believe how lucky we are? We have just enough pollen to do the job!
I think this is gonna work.
It's got to work.
Attention, passengers, this is Captain Scott. We have a bit of bad weather in New York. It looks like we'll experience a couple hours delay.
Barry, these are cut flowers with no water. They'll never make it.
I gotta get up there and talk to them.
Be careful.
Can I get help with the Sky Mall magazine? I'd like to order the talking inflatable nose and ear hair trimmer.
Captain, I'm in a real situation.
What'd you say, Hal?
Nothing.
Bee!
Don't freak out! My entire species...
What are you doing?
Wait a minute! I'm an attorney!
Who's an attorney?
Don't move.
Oh, Barry.
Good afternoon, passengers. This is your captain. Would a Miss Vanessa Bloome in 24B please report to the cockpit? And please hurry!
What happened here?
There was a DustBuster, a toupee, a life raft exploded.
One's bald, one's in a boat, they're both unconscious!
Is that another bee joke?
No!
No one's flying the plane!
This is JFK control tower, Flight 356. What's your status?
This is Vanessa Bloome. I'm a florist from New York.
Where's the pilot?
He's unconscious, and so is the copilot.
Not good. Does anyone onboard have flight experience?
As a matter of fact, there is.
Who's that?
Barry Benson.
From the honey trial?! Oh, great.
Vanessa, this is nothing more than a big metal bee.
It's got giant wings, huge engines.
I can't fly a plane.
Why not? Isn't John Travolta a pilot?
Yes.
How hard could it be?
Wait, Barry!
We're headed into some lightning.
This is Bob Bumble. We have some late-breaking news from JFK Airport, where a suspenseful scene is developing.
Barry Benson, fresh from his legal victory...
That's Barry!
...is attempting to land a plane, loaded with people, flowers and an incapacitated flight crew.
Flowers?!
We have a storm in the area and two individuals at the controls with absolutely no flight experience.
Just a minute. There's a bee on that plane.
I'm quite familiar with Mr. Benson and his no-account compadres.
They've done enough damage.
But isn't he your only hope?
Technically, a bee shouldn't be able to fly at all.
Their wings are too small... Haven't we heard this a million times?
"The surface area of the wings and body mass make no sense."
Get this on the air!
Got it.
Stand by.
We're going live.
The way we work may be a mystery to you. Making honey takes a lot of bees doing a lot of small jobs.
But let me tell you about a small job. If you do it well, it makes a big difference.
More than we realized. To us, to everyone.
That's why I want to get bees back to working together. That's the bee way! We're not made of Jell-O.
We get behind a fellow.
Black and yellow!
Hello!
Left, right, down, hover.
Hover?
Forget hover.
This isn't so hard.
Beep-beep! Beep-beep!
Barry, what happened?!
Wait, I think we were on autopilot the whole time.
That may have been helping me.
And now we're not!
So it turns out I cannot fly a plane.
All of you, let's get behind this fellow! Move it out!
Move out!
Our only chance is if I do what I'd do, you copy me with the wings of the plane!
Don't have to yell.
I'm not yelling! We're in a lot of trouble.
It's very hard to concentrate with that panicky tone in your voice!
It's not a tone. I'm panicking!
I can't do this!
Vanessa, pull yourself together. You have to snap out of it!
You snap out of it.
You snap out of it.
You snap out of it!
You snap out of it!
You snap out of it!
You snap out of it!
You snap out of it!
You snap out of it!
Hold it!
Why? Come on, it's my turn.
How is the plane flying?
I don't know.
Hello?
Benson, got any flowers for a happy occasion in there?
The Pollen Jocks!
They do get behind a fellow.
Black and yellow.
Hello.
All right, let's drop this tin can on the blacktop.
Where? I can't see anything. Can you?
No, nothing. It's all cloudy.
Come on. You got to think bee, Barry.
Thinking bee.
Thinking bee.
Thinking bee!
Thinking bee! Thinking bee!
Wait a minute. I think I'm feeling something.
What?
I don't know. It's strong, pulling me.
Like a 27-million-year-old instinct.
Bring the nose down.
Thinking bee!
Thinking bee! Thinking bee!
What in the world is on the tarmac?
Get some lights on that!
Thinking bee!
Thinking bee! Thinking bee!
Vanessa, aim for the flower.
OK.
Cut the engines. We're going in on bee power. Ready, boys?
Affirmative!
Good. Good. Easy, now. That's it.
Land on that flower!
Ready? Full reverse!
Spin it around!
Not that flower! The other one!
Which one?
That flower.
I'm aiming at the flower!
That's a fat guy in a flowered shirt.
I mean the giant pulsating flower made of millions of bees!
Pull forward. Nose down. Tail up.
Rotate around it.
This is insane, Barry!
This's the only way I know how to fly.
Am I koo-koo-kachoo, or is this plane flying in an insect-like pattern?
Get your nose in there. Don't be afraid. Smell it. Full reverse!
Just drop it. Be a part of it.
Aim for the center!
Now drop it in! Drop it in, woman!
Come on, already.
Barry, we did it! You taught me how to fly!
Yes. No high-five!
Right.
Barry, it worked!
Did you see the giant flower?
What giant flower? Where? Of course
I saw the flower! That was genius!
Thank you.
But we're not done yet.
Listen, everyone!
This runway is covered with the last pollen from the last flowers available anywhere on Earth.
That means this is our Last Chance. We're the only ones who make honey, pollinate flowers and dress like this.
If we're gonna survive as a species, this is our moment! What do you say?
Are we going to be bees, or just Museum of Natural History keychains?
We're bees!
Keychain!
Then follow me! Except Keychain.
Hold on, Barry. Here. You've earned this.
Yeah!
I'm a Pollen Jock! And it's a perfect fit. All I gotta do are the sleeves.
Oh, yeah.
That's our Barry.
Mom! The bees are back!
If anybody needs to make a call, now's the time. I got a feeling we'll be working late tonight!
Here's your change. Have a great afternoon! Can I help who's next?
Would you like some honey with that?
It is bee-approved. Don't forget these.
Milk, cream, cheese, it's all me. And I don't see a nickel!
Sometimes I just feel like a piece of meat!
I had no idea.
Barry, I'm sorry.
Have you got a moment?
Would you excuse me?
My mosquito associate will help you.
Sorry I'm late.
He's a lawyer too?
I was already a blood-sucking parasite. All I needed was a briefcase.
Have a great afternoon!
Barry, I just got this huge tulip order, and I can't get them anywhere.
No problem, Vannie. Just leave it to me.
You're a lifesaver, Barry. Can I help who's next?
All right, scramble, jocks! It's time to fly.
Thank you, Barry!
That bee is living my life!
Let it go, Kenny.
When will this nightmare end?!
Let it all go.
Beautiful day to fly.
Sure is.
Between you and me,
I was dying to get out of that office.
You have got to start thinking bee, my friend.
Thinking bee!
Me?
Hold it. Let's just stop for a second. Hold it.
I'm sorry. I'm sorry, everyone. Can we stop here?
I'm not making a major life decision during a production number!
All right. Take ten, everybody. Wrap it up, guys.
I had virtually no rehearsal for that.
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
#echo "Not yet 😉" > "második videó.md"
echo "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
fi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="author" content="Tóth Miklós">
<meta name="dcterms.date" content="2021-03-21">
<title>Linux előadás</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="https://unpkg.com/reveal.js@^4//dist/reset.css">
<link rel="stylesheet" href="https://unpkg.com/reveal.js@^4//dist/reveal.css">
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<link rel="stylesheet" href="https://unpkg.com/reveal.js@^4//dist/theme/black.css" id="theme">
</head>
<body>
<div class="reveal">
<div class="slides">
<section id="title-slide">
<h1 class="title">Linux előadás</h1>
<p class="author">Tóth Miklós</p>
<p class="date">March 21, 2021</p>
</section>
<section id="pár-egyéb-hasznos-parancs" class="slide level1">
<h1>Pár egyéb hasznos parancs</h1>
</section>
<section id="wc" class="slide level1">
<h1><code>wc</code></h1>
<ul>
<li>word counter</li>
<li>szavak, sorok számolása</li>
</ul>
<pre class="shell-session"><code>[mike@thinkyboi ~]$ echo &quot;egy két há&quot; | wc -w
3
[mike@thinkyboi ~]$ echo &quot;egy két há&quot; | wc -l
1
[mike@thinkyboi ~]$ echo &quot;egy
két
&quot; | wc -l
3</code></pre>
</section>
<section id="tr" class="slide level1">
<h1><code>tr</code></h1>
<ul>
<li>karaktereket cserél ki vagy töröl</li>
</ul>
<pre class="shell-session"><code>[mike@thinkyboi ~]$ echo &quot;almafa&quot; | tr &quot;a&quot; &quot;e&quot;
elmefe
[mike@thinkyboi ~]$ echo &quot;almafa körtefa eperfa&quot; | tr &quot; &quot; &quot;\n&quot;
almafa
körtefa
eperfa
[mike@thinkyboi ~]$ echo &quot;almafa&quot; | tr -d &quot;a&quot;
lmf</code></pre>
</section>
<section id="curl" class="slide level1">
<h1><code>curl</code></h1>
<ul>
<li>http shellből</li>
<li>stdout-ra írja ki, kivéve, ha van <code>-o</code> kapcsoló</li>
</ul>
<pre class="shell-session"><code>[mike@thinkyboi ~]$ curl https://home.sch.bme.hu/~mikewashere/linux/eloadas.md | grep stdout
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 777 100 777 0 0 33782 0 --:--:-- --:--:-- --:--:-- 33782
- stdout-ra írja ki
[mike@thinkyboi ~]$ curl https://home.sch.bme.hu/~mikewashere/linux/eloadas.md -o eloadas.md
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 777 100 777 0 0 31080 0 --:--:-- --:--:-- --:--:-- 31080
[mike@thinkyboi ~]$ </code></pre>
</section>
<section id="sh-fileok" class="slide level1">
<h1><code>.sh</code> fileok</h1>
<ul>
<li>shell automatizálása</li>
<li>mintha soronként kiadnánk a parancsokat</li>
</ul>
</section>
<section id="egy-.sh-file" class="slide level1">
<h1>egy <code>.sh</code> file</h1>
<pre class="shell-session"><code>[mike@thinkyboi tmp]$ vi test.sh
[mike@thinkyboi tmp]$ cat test.sh
echo &quot;ez simán működik&quot; | cowsay
curl &quot;https://home.sch.bme.hu/~mikewashere/linux/eloadas.md&quot; | grep &quot;soronként&quot; | cowsay
[mike@thinkyboi tmp]$ bash test.sh
_____________________
&lt; ez simán működik &gt;
---------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1596 100 1596 0 0 69391 0 --:--:-- --:--:-- --:--:-- 69391
_________________________________
/ - mintha soronként kiadnánk a \
\ parancsokat /
---------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
[mike@thinkyboi tmp]$ </code></pre>
</section>
<section id="shebang" class="slide level1">
<h1>shebang</h1>
<ul>
<li>file futtatásakor a kernel meglesi mi van az elején</li>
<li>el tudunk indítani scripteket programként</li>
<li><code>#!&lt;program&gt;</code></li>
</ul>
</section>
<section id="shebang-1" class="slide level1">
<h1>shebang</h1>
<pre class="shell-session"><code>[mike@thinkyboi tmp]$ vi test.sh
[mike@thinkyboi tmp]$ cat test.sh
#!/bin/bash
echo &quot;ez simán működik&quot; | cowsay
curl &quot;https://home.sch.bme.hu/~mikewashere/linux/eloadas.md&quot; | grep &quot;soronként&quot; | cowsay
[mike@thinkyboi tmp]$ chmod +x test.sh
[mike@thinkyboi tmp]$ ./test.sh
_____________________
&lt; ez simán működik &gt;
---------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1596 100 1596 0 0 11319 0 --:--:-- --:--:-- --:--:-- 11319
_________________________________
/ - mintha soronként kiadnánk a \
\ parancsokat /
---------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
[mike@thinkyboi tmp]$ </code></pre>
</section>
<section id="tűzfal" class="slide level1">
<h1>tűzfal</h1>
<ul>
<li>a kernel belsejében -&gt; gyors, de low-level</li>
<li>iptables</li>
<li>kényelmesebb egy tűzfal-kezelő</li>
</ul>
</section>
<section id="ufw" class="slide level1">
<h1>UFW</h1>
<ul>
<li>uncomplicated firewall</li>
<li>egyszerű</li>
</ul>
<pre class="shell-session"><code>[mike@thinkyboi tmp]$ sudo ufw allow 80
Rules updated
Rules updated (v6)
[mike@thinkyboi tmp]$ sudo ufw allow https
Rules updated
Rules updated (v6)
[mike@thinkyboi tmp]$ sudo ufw enable</code></pre>
</section>
<section id="ssh-kulcsok" class="slide level1">
<h1>SSH kulcsok</h1>
<ul>
<li>biztonságosabb, mint egy jelszó</li>
<li>sok algoritmus, RSA, elliptikus görbék</li>
<li>publikus-privát</li>
<li>privát saját gépen, védve</li>
<li>publikus ott, ahova belépnénk</li>
<li><code>~/.ssh/authorized_keys</code></li>
</ul>
</section>
<section id="generálás" class="slide level1">
<h1>Generálás</h1>
<pre class="shell-session"><code>mike@thinkyboi:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mike/.ssh/id_rsa):
Created directory &#39;/home/mike/.ssh&#39;.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mike/.ssh/id_rsa
Your public key has been saved in /home/mike/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:tYZX08XEZfJP5j/um2Y9KUgG+jffe82ONwgzkt4p0hc mike@thinkyboi
The key&#39;s randomart image is:
+---[RSA 3072]----+
| .+*|
| . =o|
| . o . +|
| + o . +.|
| S * o|
| . = E .|
| + = B .o=|
| . = B ooBO|
| . + o.*XB|
+----[SHA256]-----+
mike@thinkyboi:~$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjAZMAbpNutuc/ZgHWMcjWcPQOC0d8+JrDaHMnxZfRtfdyrgZDfPmMER95148JVEfkjjhur8a+IEfQM59o+yq95+yNvJFT6Nr5JzHK8dC5IuDvvEVNrKPwmW4UIgm1e5b95pGivJ5cnoiXevtp87seaxh0DlZFONKUeIFnwyDBUII7mRyXDn7MrFlAcxXtlZnSSCXXLGUMZI7nldiyRI9gXlZYCpfA8XrXrnM6JAIA+6VozhJurAKhygV6rH5yD4Vg+/Bs+wigywE3U79gbqpPzRegmxzKdgv+NNKV900DQVYNzvCU5o6q9d2amU+CDSw6KjU+4SLFOgZ3myXCyE9er3aaROj22sQdPwv8CnwtZstRibpp2SU627J4Vr7caPl8wrZcGvmXgD50mPh9Kdd+Yr5WJFSaAcog082aWBdrB3Qr9LM5DgcWulyDmUMmjA2WWCJN+t6vDT5d+2mYeBiZ2OY5ZkHyUjD6GVGBOZP/lP9EAxi3XwoM3V8TwoEgLD8= mike@thinkyboi
mike@thinkyboi:~$ </code></pre>
</section>
<section id="operátor" class="slide level1">
<h1><code>&gt;&gt;</code> operátor</h1>
<ul>
<li><code>&gt;</code> tesója</li>
<li>filehoz appendál</li>
</ul>
<pre class="shell"><code>curl https://git.sch.bme.hu/mikewashere.keys &gt;&gt; ~/.ssh/authorized_keys</code></pre>
</section>
<section id="házi-feladatok" class="slide level1">
<h1>Házi Feladatok</h1>
</section>
<section id="alap-házi" class="slide level1">
<h1>Alap házi</h1>
<p>Csinálj felhasználót a csapattársaidnak a VM-edre úgy, hogy hozzáférjenek a statikus weboldalak mappájához, ezután próbáljátok ki, hogy valóban hozzáfértek-e és ha igen, rakjatok valami funky html-t a mappába ajándékba a társaitoknak.</p>
<p>Hint: adduser/useradd, usermod/gpasswd, chmod.</p>
</section>
<section id="side-quest" class="slide level1">
<h1>Side Quest</h1>
<p>Állíts be kulcsos hitelesítést a képzés VM-eden az SSH kapcsolatodhoz. Ehhez szükséged lesz egy privát és egy publikus kulcsra a kliensgépeden.</p>
<p>Hint: ssh-keygen.</p>
</section>
<section id="expert-sudo" class="slide level1">
<h1>Expert (sudo)</h1>
<p>Nyomozz hogyan és miért műküdik a sudo parancs! Ha megtaláltad próbáld meg összefoglalni nekünk néhány mondatban.</p>
<p>Hint: setuid</p>
</section>
<section id="expert-csomag-mágus" class="slide level1">
<h1>Expert (Csomag mágus)</h1>
<p>Készíts egy új csomagot (package) egy általad válaszott programból (saját program is lehet), egy általad választott disztribúcióhoz.</p>
</section>
<section id="jó-munkát" class="slide level1">
<h1>Jó munkát!</h1>
</section>
</div>
</div>
<script src="https://unpkg.com/reveal.js@^4//dist/reveal.js"></script>
// reveal.js plugins
<script src="https://unpkg.com/reveal.js@^4//plugin/notes/notes.js"></script>
<script src="https://unpkg.com/reveal.js@^4//plugin/search/search.js"></script>
<script src="https://unpkg.com/reveal.js@^4//plugin/zoom/zoom.js"></script>
<script>
// Full list of configuration options available at:
// https://revealjs.com/config/
Reveal.initialize({
// Push each slide change to the browser history
history: true,
// reveal.js plugins
plugins: [
RevealNotes,
RevealSearch,
RevealZoom
]
});
</script>
</body>
</html>
% Linux előadás
% Tóth Miklós
% March 21, 2021
# Pár egyéb hasznos parancs
# `wc`
- word counter
- szavak, sorok számolása
```shell-session
[mike@thinkyboi ~]$ echo "egy két há" | wc -w
3
[mike@thinkyboi ~]$ echo "egy két há" | wc -l
1
[mike@thinkyboi ~]$ echo "egy
két
há" | wc -l
3
```
# `tr`
- karaktereket cserél ki vagy töröl
```shell-session
[mike@thinkyboi ~]$ echo "almafa" | tr "a" "e"
elmefe
[mike@thinkyboi ~]$ echo "almafa körtefa eperfa" | tr " " "\n"
almafa
körtefa
eperfa
[mike@thinkyboi ~]$ echo "almafa" | tr -d "a"
lmf
```
# `curl`
- http shellből
- stdout-ra írja ki, kivéve, ha van `-o` kapcsoló
```shell-session
[mike@thinkyboi ~]$ curl https://home.sch.bme.hu/~mikewashere/linux/eloadas.md | grep stdout
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 777 100 777 0 0 33782 0 --:--:-- --:--:-- --:--:-- 33782
- stdout-ra írja ki
[mike@thinkyboi ~]$ curl https://home.sch.bme.hu/~mikewashere/linux/eloadas.md -o eloadas.md
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 777 100 777 0 0 31080 0 --:--:-- --:--:-- --:--:-- 31080
[mike@thinkyboi ~]$
```
# `.sh` fileok
- shell automatizálása
- mintha soronként kiadnánk a parancsokat
# egy `.sh` file
```shell-session
[mike@thinkyboi tmp]$ vi test.sh
[mike@thinkyboi tmp]$ cat test.sh
echo "ez simán működik" | cowsay
curl "https://home.sch.bme.hu/~mikewashere/linux/eloadas.md" | grep "soronként" | cowsay
[mike@thinkyboi tmp]$ bash test.sh
_____________________
< ez simán működik >
---------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1596 100 1596 0 0 69391 0 --:--:-- --:--:-- --:--:-- 69391
_________________________________
/ - mintha soronként kiadnánk a \
\ parancsokat /
---------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
[mike@thinkyboi tmp]$
```
# shebang
- file futtatásakor a kernel meglesi mi van az elején
- el tudunk indítani scripteket programként
- `#!<program>`
# shebang
```shell-session
[mike@thinkyboi tmp]$ vi test.sh
[mike@thinkyboi tmp]$ cat test.sh
#!/bin/bash
echo "ez simán működik" | cowsay
curl "https://home.sch.bme.hu/~mikewashere/linux/eloadas.md" | grep "soronként" | cowsay
[mike@thinkyboi tmp]$ chmod +x test.sh
[mike@thinkyboi tmp]$ ./test.sh
_____________________
< ez simán működik >
---------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1596 100 1596 0 0 11319 0 --:--:-- --:--:-- --:--:-- 11319
_________________________________
/ - mintha soronként kiadnánk a \
\ parancsokat /
---------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
[mike@thinkyboi tmp]$
```
# tűzfal
- a kernel belsejében -> gyors, de low-level
- iptables
- kényelmesebb egy tűzfal-kezelő
# UFW
- uncomplicated firewall
- egyszerű
```shell-session
[mike@thinkyboi tmp]$ sudo ufw allow 80
Rules updated
Rules updated (v6)
[mike@thinkyboi tmp]$ sudo ufw allow https
Rules updated
Rules updated (v6)
[mike@thinkyboi tmp]$ sudo ufw enable
```
# SSH kulcsok
- biztonságosabb, mint egy jelszó
- sok algoritmus, RSA, elliptikus görbék
- publikus-privát
- privát saját gépen, védve
- publikus ott, ahova belépnénk
- `~/.ssh/authorized_keys`
# Generálás
```shell-session
mike@thinkyboi:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mike/.ssh/id_rsa):
Created directory '/home/mike/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mike/.ssh/id_rsa
Your public key has been saved in /home/mike/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:tYZX08XEZfJP5j/um2Y9KUgG+jffe82ONwgzkt4p0hc mike@thinkyboi
The key's randomart image is:
+---[RSA 3072]----+
| .+*|
| . =o|
| . o . +|
| + o . +.|
| S * o|
| . = E .|
| + = B .o=|
| . = B ooBO|
| . + o.*XB|
+----[SHA256]-----+
mike@thinkyboi:~$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjAZMAbpNutuc/ZgHWMcjWcPQOC0d8+JrDaHMnxZfRtfdyrgZDfPmMER95148JVEfkjjhur8a+IEfQM59o+yq95+yNvJFT6Nr5JzHK8dC5IuDvvEVNrKPwmW4UIgm1e5b95pGivJ5cnoiXevtp87seaxh0DlZFONKUeIFnwyDBUII7mRyXDn7MrFlAcxXtlZnSSCXXLGUMZI7nldiyRI9gXlZYCpfA8XrXrnM6JAIA+6VozhJurAKhygV6rH5yD4Vg+/Bs+wigywE3U79gbqpPzRegmxzKdgv+NNKV900DQVYNzvCU5o6q9d2amU+CDSw6KjU+4SLFOgZ3myXCyE9er3aaROj22sQdPwv8CnwtZstRibpp2SU627J4Vr7caPl8wrZcGvmXgD50mPh9Kdd+Yr5WJFSaAcog082aWBdrB3Qr9LM5DgcWulyDmUMmjA2WWCJN+t6vDT5d+2mYeBiZ2OY5ZkHyUjD6GVGBOZP/lP9EAxi3XwoM3V8TwoEgLD8= mike@thinkyboi
mike@thinkyboi:~$
```
# `>>` operátor
- `>` tesója
- filehoz appendál
```shell
curl https://git.sch.bme.hu/mikewashere.keys >> ~/.ssh/authorized_keys
```
# Házi Feladatok
# Alap házi
Csinálj felhasználót a csapattársaidnak a VM-edre úgy, hogy
hozzáférjenek a statikus weboldalak mappájához,
ezután próbáljátok ki, hogy valóban hozzáfértek-e
és ha igen, rakjatok valami funky html-t a mappába ajándékba a társaitoknak.
Hint: adduser/useradd, usermod/gpasswd, chmod.
# Side Quest
Állíts be kulcsos hitelesítést a képzés VM-eden az SSH kapcsolatodhoz.
Ehhez szükséged lesz egy privát és egy publikus kulcsra a kliensgépeden.
Hint: ssh-keygen.
# Expert (sudo)
Nyomozz hogyan és miért műküdik a sudo parancs!
Ha megtaláltad próbáld meg összefoglalni nekünk néhány mondatban.
Hint: setuid
# Expert (Csomag mágus)
Készíts egy új csomagot (package) egy általad válaszott programból
(saját program is lehet), egy általad választott disztribúcióhoz.
# Jó munkát!
presentation.html
index.html
---
marp: true
theme: gaia
class: [lead, invert]
---
# KSZKépzés Linux
Tóth Miklós
---
<!-- class: [invert] -->
## Mi is a Linux?
- kernel
- de! GNU/Linux már OS
- disztrók
- GUI
- CLI
---
## CLI
*Command Line Interface*
- terminál
- shell
- sh
- bash
- zsh
- fish
---
## Shelles fogalmak
- kapcsolók `rm -rf`
- redirekció `ls > fajllista.txt`
- piping `cat alma.txt | grep körte`
- shell execution `echo a mappa tartalma: $(ls)`
---
## Szövegszerkesztők
- nano
- vi, vim, nvim
---
## Gyakori parancsok
- ls
- man
- cat
- echo
- cd
- mkdir
- rm
- rmdir
- touch
---
## Csomagkezelés
- Mi a csomag?
- Hogyan telepítünk programokat Linuxon?
- Miért jó ez?
- Hogy működik az `apt`?
---
## Fájlkezelés
- `/` jel van `\` helyett
- nincs `C:\`, hanem `/`-ből indul minden
- `/etc`, `/dev`, `/home`, `/bin`, `/lib`, `/proc`, stb.
- `../`, `./`, `~`, `~bela`
---
## Jogosultságok
- `user`, `group`, `others`
- `rwx` hármasok
- `setuid`, `setgid`, `sticky bit`
- `chmod`, `chown`, `chgrp`
---
## UNIX elvek
- KISS
- Everything is a file
---
## Architektúra
- Bootloader
- Kernel
- Init rendszer
- "Userland"
---
## Felhasználókezelés
- `useradd`, `usermod`, `userdel`
- (`adduser`, `deluser`)
- `passwd`
- `sudo`
---
## Csoportok
- `groups`
- `groupadd`, `groupdel`
- `usermod`
- `gpasswd`
---
## Init rendszer, systemd
- Miért?
- Mi egy service?
- systemctl
- journalctl
---
## Hálózat
- `ip address`, `ip addr add`
- `ip route`, `ip route add`
- hálózatkezelők, `NetworkManager`
---
## SSH
- secure remote shell
- kulcsok
- sok egyéb okos feature
---
<!-- class: [lead, invert] -->
# Kahoot!
---
# Workshop time!
---
<!-- class: [invert] -->
## 1. feladat
Telepíts fel egy apache2 webszervert és állítsd be, hogy egy mappában lévő szkripteket lefuttasson és kimenetüket leküldje!
---
```sh
sudo ln -s /etc/apache2/mods-available/cgi.load /etc/apache2/mods-enabled/
```
```sh
sudo nano /etc/apache2/sites-enabled/000-default.conf
```
```
<VirtualHost *:80>
[...]
<Directory "/var/www/html/scripts">
AllowOverride None
Require all granted
Options +ExecCGI
AddHandler cgi-script .cgi .pl .py .sh
</Directory>
DocumentRoot /var/www/html
[...]
</VirtualHost>
```
---
```sh
#!/bin/bash
echo Content-type: text/html
echo
echo hello world
```
---
## 2. Feladat
- Nézzük meg milyen userként fut a webszerver!
- Csináljunk egy oldalt, ami kiírja az időt és azt, hogy hány user van belépve!
- Csináljunk egy oldalt, ami kiírja, hogy hányadik hét van!
- hint: `jq`, https://hanyadikhetvan.attiss.eu/api
\ No newline at end of file
favicon.ico

117 KiB

# Gyakorlat
## 0. csatlakozás a VM-hez
[see here](saját%20vm.md)
Ha gondoljátok vagy ha valaki nem nézett videót/jegyzetet és nem érti mi van,
akkor akár itt érdemes shellt mutogatni.
## 1. saját user létrehozása root jogokkal
Mindenki választ magának usert (nem kell schacc legyen), aztán
```shell
sudo useradd -s /bin/bash -m bela
```
`-m` = legyen home mappa
ha megadják a `-G sudo` kapcsolót is, akkor nice, már van is sudo joguk,
a kövi rész skippelhető
legyen jelszó:
```shell
passwd bela
```
legyen sudo:
```shell
sudo usermod -aG sudo bela
```
ezzel lett sudo joga
### Alternatív
legyen user:
```shell
sudo adduser bela
```
legyen sudo:
```shell
sudo adduser bela sudo
```
---
a végén jelentkezzetek át az új userbe
## 2. shell játszadozás
Feladat: számoljuk meg, hogy a *Bee Movie* szövegében hányszor szerepel a
kis és nagybetűs "bee" szó.
Ha lehet oldják meg maguktól, de vezethetitek is.
A szöveg elérhető itt: https://home.sch.bme.hu/~mikewashere/linux/best_movie_ever.txt
Vezessük végig őket lépésenként, hogy mit csinál a csomó parancs:
```shell
curl https://home.sch.bme.hu/~mikewashere/linux/best_movie_ever.txt
```
-> letölti a szöveget és kiírja
olvassunk be less-sel
```shell
curl https://home.sch.bme.hu/~mikewashere/linux/best_movie_ever.txt | less
```
Na de oldjuk is meg a feladatot:
Okés, de:
számolni a `wc`-vel lehet, de kéne szűrni a bee-kre, arra kell a `grep`,
de:
a `grep` az egész sort odaadja, amiben egyszer is ott a bee
tehát szét kéne szedni úgy, hogy minden szó külön sor legyen
Megoldás: cseréljük ki a space-eket `\n`-re a `tr` használatával.
```shell
curl https://home.sch.bme.hu/~mikewashere/linux/best_movie_ever.txt | tr " " "\n"
```
Az idézőjelek fontosak.
Most már soronként jelenik meg, mehet a grep.
```shell
curl https://home.sch.bme.hu/~mikewashere/linux/best_movie_ever.txt | tr " " "\n" | grep -i bee
```
Na most van egy csomó bee-nk, mehet a wc.
```shell
curl https://home.sch.bme.hu/~mikewashere/linux/best_movie_ever.txt | tr " " "\n" | grep -i bee | wc -l
```
Elvileg **171**-et kéne kapni.
Ha zavar minket a curl letöltés mutató szövege, akkor adjunk neki egy `2>/dev/null`-t.
```shell
curl https://home.sch.bme.hu/~mikewashere/linux/best_movie_ever.txt 2>/dev/null | tr " " "\n" | grep -i bee | wc -l
```
2 = stderr, /dev/null = speciális file, amibe bármit írhatunk, elveszik
---
Feladat: A méhek száma évről évre csökken, *let's save the bees*!
Írjuk bele a "bee"-ket egy fileba!
```shell
curl https://home.sch.bme.hu/~mikewashere/linux/best_movie_ever.txt | tr " " "\n" | grep -i bee > save_the_bees.txt
```
`nano save_the_bees.txt`-vel megleshetjük, hogy működött.
## 3. Script irogatás
Feladat: csináljunk egy scriptet, ami megmenti a méheket, és egy tehénnel kimondatja, hogy
hányan vannak.
A `cowsay` nincs fent a VM-eken, telepítsétek.
```shell
sudo apt install cowsay
```
Nyugodtan próbálgassátok ki.
```shell
cowsay hello
echo hello | cowsay
```
Csináljunk nano-val (vagy vim-mel, ha valaki azt szereti inkább)
egy új file-t, nevezzük el `bees.sh`-nak.
```shell
nano bees.sh
```
Vezessétek végig őket a megírásán vagy csináltassátok meg velük, itt egy mintamegoldás:
```shell
#!/bin/bash
curl https://home.sch.bme.hu/~mikewashere/linux/best_movie_ever.txt | tr " " "\n" | grep -i bee > save_the_bees.txt
echo $(cat save_the_bees.txt | wc -l ) méh van. | cowsay
```
*A felső sor opcionális.*
Ha megvan, futtassátok:
```shell
bash bees.sh
```
vagy, ha odatettétek az elejére a shebang-et:
```shell
chmod +x bees.sh
./bees.sh
```
## 4. Webszerver telepítése
Feladat: állítsanak be egy webszervert nginx-el, és rakjanak ki valami szöveget.
Telepítés:
```shell
sudo apt install nginx
```
Magától elindul, nézzük meg:
```shell
systemctl status nginx
```
Alapból a `/var/www/html`-t szolgálja ki, menjünk oda
```shell
cd /var/www/html
ls -la
```
Látjuk, hogy root-é minden, adjuk oda a www-data-nak, magunknak meg adjunk www-data csoporttagságot
és adjunk a csoportnak minden jogot rekurzívan.
```shell
sudo chown -R www-data:www-data /var/www/html
sudo usermod -aG www-data bela
sudo chmod -R g+rwx /var/www/html
```
`-R`: rekurzívan
vegyük fel a csoporttagságot, ehhez vagy ki és bejelentkezni kell vagy:
```shell
newgrp www-data
```
Most töröljük a korábbi weblapot és tegyünk ki valami sajátot:
```shell
cd /var/www/html
rm index.nginx-debian.html
nano index.html # írjanak bele bármi funky szöveget
```
## 5. Csináljunk tűzfalat
Az UFW (Uncomplicated FireWall) egy egyszerű tűzfalvezérlő progi.
Nézzük meg fut-e:
```shell
sudo systemctl status ufw
sudo ufw status
```
Fut, de ki van kapcsolva.
Előszöris engedjük be az SSH-t és http-t, hogy ne zárjuk ki magunkat:
```shell
sudo ufw limit ssh
sudo ufw allow http
```
A limit-tel limitálva engedélyeztük az ssh-t, így nem lehet gyorsan brute-force-olni.
és kapcsoljuk be:
```shell
sudo ufw enable
sudo ufw status
```
nice.
## Extra feladatötlet turbóújoncoknak
Csináljanak valami fancy weboldalt. Bármit.
# Házi Feladatok
## Alap házi
Csinálj felhasználót a csapattársaidnak a VM-edre úgy, hogy
hozzáférjenek a statikus weboldalak mappájához,
ezután próbáljátok ki, hogy valóban hozzáfértek-e
és ha igen, rakjatok valami funky html-t a mappába ajándékba a társaitoknak.
Hint: adduser/useradd, usermod/gpasswd, chmod.
## Side Quest
Állíts be kulcsos hitelesítést a képzés VM-eden az SSH kapcsolatodhoz.
Ehhez szükséged lesz egy privát és egy publikus kulcsra a kliensgépeden.
Hint: ssh-keygen.
## Expert (sudo)
Nyomozz hogyan és miért műküdik a sudo parancs!
Ha megtaláltad próbáld meg összefoglalni nekünk néhány mondatban.
Hint: setuid
## Expert (Csomag mágus)
Készíts egy új csomagot (package) egy általad válaszott programból
(saját program is lehet), egy általad választott disztribúcióhoz.
......@@ -4,24 +4,83 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>KSZKépzés Linux</title>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<script async defer data-domain="home.sch.bme.hu" src="https://analytics.mikesweb.site/js/plausible.js"></script>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" href="https://unpkg.com/docute@4/dist/docute.css">
<style>
.medium-zoom-overlay {
background: #2f3136 !important;
}
</style>
</head>
<body>
<div id="docute"></div>
<script src="https://unpkg.com/docute@4/dist/docute.js"></script>
<script>
new Docute({
target: '#docute',
title: 'Linux',
layout: 'wide',
highlight: [
"bash",
"javascript",
"html"
],
detectSystemDarkTheme: true,
darkThemeToggler: true,
})
async function init() {
try {
const keys = await caches.keys();
for (const key of keys) {
const cache = await caches.open(key);
const cacheKeys = await cache.keys();
for (const k of cacheKeys) {
await cache.delete(k);
}
}
} catch (e){
console.log(e);
}
let tmp = [
"linux alapok",
"szerver kezelés",
];
let pages = [];
tmp.forEach(val => {
pages.push({
title: val,
link: encodeURI("/" + val),
});
});
new Docute({
target: '#docute',
title: 'Linux',
layout: 'wide',
highlight: [
"bash",
"javascript",
"html",
"shell-session"
],
detectSystemDarkTheme: true,
darkThemeToggler: true,
nav: [
{
title: "/",
link: '/'
},
{
title: "Source",
link: "https://git.sch.bme.hu/mikewashere/linux-presentation"
},
],
sidebar: [
{
title: "linux/",
children: pages,
},
],
fetchOptions: { cache: 'no-cache' },
});
console.log("i like your curiosity");
}
init();
</script>
</body>
</html>
\ No newline at end of file
</html>
apiVersion: apps/v1
kind: Deployment
metadata:
name: linux-presentation
namespace: kszk-kepzes-site
spec:
selector:
matchLabels:
app: linux-presentation
template:
metadata:
labels:
app: linux-presentation
spec:
containers:
- name: linux-presentation
image: harbor.sch.bme.hu/kszk/linux-presentation:latest
resources:
limits:
memory: "64Mi"
ports:
- containerPort: 80
imagePullSecrets:
- name: harbor
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: 'true'
nginx.ingress.kubernetes.io/proxy-body-size: 20m
nginx.ingress.kubernetes.io/rewrite-target: /$1
name: linux-presentation
namespace: kszk-kepzes-site
spec:
rules:
- host: ujonc.kszk.bme.hu
http:
paths:
- path: /studies/linux/(.*)
pathType: Prefix
backend:
service:
name: linux-presentation
port:
number: 80
tls:
- hosts:
- ujonc.kszk.bme.hu
secretName: kszkepzes-cert
apiVersion: v1
kind: Service
metadata:
name: linux-presentation
namespace: kszk-kepzes-site
spec:
selector:
app: linux-presentation
ports:
- port: 80
targetPort: 80
# Linux alapok (1. videó segédlet)
## Mi is a Linux
A [Linux](https://www.kernel.org/) önmaga csak egy kernel, nem tartalmaz egy programot sem.
Amikor Linuxról beszélünk, általában GNU/Linux-ra gondolunk,
ami azt jelenti, hogy Linux kernelen futtatunk [GNU
rendszerprogramokat](https://www.gnu.org/software/coreutils/) és könyvtárakat.
<Note type="warning" label="Megjegyzés">
Ha Linux-ot mondunk ebben a segédletben, sok esetben itt is
GNU/Linux-ra gondolunk
</Note>
<Note type="tip" label="Extra infó">
Vannak nem GNU programokat használó Linux [disztribúciók](#disztribúciók) is,
pl: az Alpine Linux vagy az Android
</Note>
### Disztribúciók
Nem lenne túl kényelmes kézzel lefordítani és helyére másolni
minden programot (beleértve a fordítót és kernelt is).
Ennek a problémának az áthidalására születtek meg
a Linux disztribúciók, vagy röviden disztrók.
Egy disztró feladatai:
- telepítés megkönnyítése
- telepítő diszk, akár grafikus telepítővel
- telepítéskor alap rendszerprogramok feltelepítése
- használat megkönnyítése
- csomagkezelő biztosítása a könnyű és biztonságos
programtelepítéshez
- értelmes alapbeállítások programokhoz
- segítségkérés
- minden disztrónak van fóruma, soknak wikije is,
így az esetleges hibákra gyorsan lehet találni megoldást
[Nagyon sok disztró van](https://upload.wikimedia.org/wikipedia/commons/8/83/Linux_Distribution_Timeline_27_02_21.svg),
mindenki meg tudja találni a magának megfelelőt.
Az [Ubuntu](https://ubuntu.com/) a legelterjedtebb disztró,
a továbbiakban is Ubuntut fogunk használni, de a legtöbb dolog
univerzális.
### GUI
Linux-ra van nagyon sokféle GUI shell (vagy Desktop Environment, DE),
a legelterjedtebbek a
Gnome, KDE, Xfce.
<center>
<ImageZoom
src="pics/ubuntu.jpg"
/>
Gnome Ubuntun
<br>
</center>
<br>
<center>
<ImageZoom
src="pics/kde.jpg"
/>
KDE
<br>
</center>
<br>
<center>
<ImageZoom
src="pics/xfce.png"
/>
Xfce
<br>
</center>
<br>
<center>
<ImageZoom
src="pics/elementary.png"
/>
elementary OS
<br>
</center>
<br>
Az asztali számítógépre szánt disztrókon általában alapértelmezetten
telepítve van valamilyen DE.
## CLI, terminál, shell
<Note type="tip" label="Megjegyzés">
Ez a fejezet sok fogalmat tartalmaz, kérlek **_ne_** magold be ezeket.
Csupán annyi a célja a fejezetnek, hogy akik nemigazán
használtak CLI-t, azoknak bemutasson pár alapelemet.
A fő cél, hogy értsd, tudd használni; nem az, hogy tudd a definíciókat.
</Note>
### CLI
**C**ommand **L**ine **I**nterface,
egy felhasználói felület, ami alapvetően szövegesen kommunikál a userrel.
Szöveg be → szöveg ki.
Ennél sokkal bővebben nem hiszem,
hogy bárkinek is be kell mutatni, hogy mit jelent.
### Terminál
Ez jeleníti meg a karaktereket és adja meg a programnak a beírt karaktereket.
Régebben külön céleszközök voltak, ma már programok.
### Shell
Egy olyan CLI program, amibe parancsokat lehet bepötyögni és a shell
a megfelelő programokat elindítva és összekapcsolva<sup>(erről később lesz szó)</sup>
lefuttatja azt.
### Pár ismertebb shell
#### `sh`
[Bourne shell](https://en.wikipedia.org/wiki/Bourne_shell)
(a készítőjének neve után) vagy
[POSIX shell](https://en.wikipedia.org/wiki/Unix_shell)
Egy butább shell, ami megtalálható minden UNIX-szerű számítógépen.
Jó régen, az eredeti UNIX-hoz hozták létre a Bourne shell-t, ami később
[bővítve](https://en.wikipedia.org/wiki/KornShell), majd specifikálva lett a
[POSIX](https://en.wikipedia.org/wiki/POSIX) szabványban.
#### `bash`
**B**ourne-**a**gain **sh**ell, dupla szójáték. 😉
A [bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) az alapértelmezett shell a Linux disztribúciók
túlnyomó többségén. Később ezzel fogunk dolgozni.
Kellően okos és többnyire elvárható, hogy ott legyen mindenhol, ahova beléptek.
A hatalmas elterjedtsége (és nagy kompatibilitása) miatt esett erre a választás.
#### `zsh`
[zsh](https://en.wikipedia.org/wiki/Z_shell) vagy Z shell.
Gyakorlatilag a bash kibővítése,
a legtöbb Linuxos disztrón csomagkezelővel telepíthető,
emellett macOS-en alap shell. Minden bash parancs működik itt is,
de nem minden zsh parancs működik bash-ben.
#### `fish`
[fish](https://en.wikipedia.org/wiki/Fish_(Unix_shell)),
**f**riendly **i**nteractive **sh**ell.
Különlegessége, hogy kifejezetten felhasználóbarátnak van tervezve,
alapbeállításokkal is nagyon kényelmes használni.
Azonban *nem* POSIX shell, vagyis a következőekben bemutatott parancsok
nem feltétlenül működnek benne.
<Note type="warning" label="Figyelem">
Innentől bash-ről lesz szó. Ha olyat olvasol, hogy
"írjuk be a shellünkbe", akkor ott a "bashünkre" gondolunk.
</Note>
### Hogy is néz ki?
TL;DR: sokféleképpen.
Például sok helyen így néz ki az alap beállításokkal:
```shell-session
[mike@thinkyboi ~]$ ls *.pdf
mozilla.pdf
[mike@thinkyboi ~]$ ls *.txt
asd.txt ize.txt metrics.txt pcr2.txt pcrtouse.txt pcr.txt
[mike@thinkyboi ~]$ ls *.txt | grep rt
pcrtouse.txt
[mike@thinkyboi ~]$
```
Ez mit is mutat?
- `[mike@thinkyboi ~]$`: a prompt
- mutatja, hogy a `mike` user van belépve
- a `thinkyboi` nevű számítógépre
- éppen a `~` mappában vagyunk
- sima user jogosultságokkal `$`
- `ls *.pdf`: egy parancs, ami minden .pdf végű fájlt kilistáz
- `ls *.txt`: egy parancs, ami minden .txt végű fájlt kilistáz
- `ls *.txt | grep rt`: egy parancs, ami minden .txt végű fájlt kilistáz, mely nevében megtalálható az "rt"
Ne ijedjünk meg az ismeretlen fogalmaktól, erről mind lesz szó bővebben.
### Pár shelles fogalom
- parancs: egy program, a kapcsolói, és egyéb opciók
- általában: `parancs --kapcsoló -k fájl.txt`
- kapcsolók: programok különböző funkcióit
lehet velük ki-be kapcsolni
- pl:
- `ls -la`: kilistázza a mostani mappa tartalmát
- `ls`: listázó program
- `-l`: listaként jelenjen meg
- `-a`: rejtett fájlokat is megjeleníti
- `ls -a en_mappam`: kilistázza az `en_mappam` mappa tartalmát
a rejtett fájlokkal együtt
- `ip address`: kiírja a gépünk IP címeit
- `cd en_mappam`: belelép az `en_mappam` mappába
- `cd ..`: egy mappával feljebb lép
- redirekció (`>`, `<`)
- `>`: átirányítja egy program kimenetét egy fájlba
- `<`: egy program konzolos bemenetét egy fájlból olvassa
- pl:
- `ls > fajlok.txt`: a jelenlegi mappában létrehozza
a `fajlok.txt` fájlt és beleírja a jelenlegi
mappában lévő fájlok és mappák neveit
- pipe (`|`)
- egy program kimenetét beleírja egy másik program bemenetébe
- pl:
- `ls -l *.txt | grep alma`:
- `ls -l *.txt`: kiírja a jelenlegi mappában lévő
txt fájlok neveit, ez lesz a grep bemenete
- `grep alma`: kiszűri a bemenetén kapott szövegből
azokat a sorokat, amikben nem szerepel az alma szó
- → kilistázza azokat a txt fájlokat, amelyek nevében
szerepel az, hogy alma.
- shell execution `"$(parancs)"`
- egy program kimenetét beleteszi egy stringbe
- pl:
- `echo a mappa tartalma: $(ls)`
#### [Egyéb hasznos shell cuccok](https://devhints.io/bash)
### Szövegszerkesztők
- `nano`: egyszerű szövegszerkesztő
- terminál alján kiír pár támogatott billentyűkombinációt
- használat:
- `nano <fájl>`
- irkáljunk
- `CTRL+S` ment
- `CTRL+X` bezár
- `vi`: bonyolultabb picivel, de többet tud
- `vim`: vi improved, továbbfejlesztés
- `nvim`: neovim, vim továbbfejlesztés
- használat
- `vim <fájl>`
- `i` (insert mode)
- irkáljunk
- `ESC` (normal mode)
- `:wq` (parancs: write, quit)
- a fejlettebb funkcióit nem mutatjuk most be
### Fontosabb shell parancsok/programok
- `ls`: listáz
- `man <parancs>`: "manual", felhasználói útmutató programokhoz
- pl: `man ip`
- `cat <fájlok>`: fájlokat ír ki
- `less`: a bemenetén kapott szöveget görgeti, így lassabban
lehet olvasni, mint ahogy jön
- `echo <szöveg>`: kiír egy szöveget
- `cd <mappa>`: mappát vált
- `mkdir <mappa>`: mappa létrehozása
- `rm <fájlok>`: fájlok törlése
- `rmdir <mappa>`: mappa törlése
- `touch <fájl>`: üres fájl létrehozása
## Csomagkezelés
### Mi a csomag?
**Gyakorlatilag egy program, amit tudsz telepíteni.**
*Bővebben:*
A különböző programokat nevezzük csomagoknak (package), melyek
a bináris (futtatható) fájlokon kívül különböző konfigurációs fájlokat és
a program más programoktól való függőségeit is tartalmazza.
### Hogyan telepítsünk csomagokat?
A programokat telepíthetjük [kézzel](http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-10.1.pdf) (8.2-es fejezet), de ez
általában nehézkes művelet és nem valami hatékony,
ezért csomagkezelőt (package manager) szoktunk használni a csomagok
telepítéséhez. A csomagkezelő egy egyszerű program, mellyel biztonságosan telepíthetünk,
frissíthetünk, eltávolíthatunk és kereshetünk csomagokat.
Egy csomagkezelő frissen tudja tartani a rendszert, kezeli a függőségeket és ütközéseket.
Mi az apt nevű csomagkezelőt fogjuk használni a továbbiakban.
```shell-session {highlight: [1, 3, 12, 24, 33, 42, 51, 59, 61]}
[patrik@patrik-laptop ~]$ cowsay test
bash: cowsay: command not found
[patrik@patrik-laptop ~]$ sudo apt update
Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
[...]
Fetched 17.2 MB in 2s (11.2 MB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
[patrik@patrik-laptop ~]$ sudo apt search cowsay
Sorting... Done
Full Text Search... Done
cowsay/focal 3.03+dfsg2-7 all
configurable talking cow
cowsay-off/focal 3.03+dfsg2-7 all
configurable talking cow (offensive cows)
xcowsay/focal 1.5-1 amd64
Graphical configurable talking cow
[patrik@patrik-laptop ~]$ sudo apt install cowsay
Reading package lists... Done
Building dependency tree
Reading state information... Done
[...]
After this operation, 46.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
[...]
Setting up cowsay (3.03+dfsg2-7) ...
[patrik@patrik-laptop ~]$ cowsay test
______
< test >
------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
[patrik@patrik-laptop ~]$ sudo apt upgrade
[...]
The following packages will be upgraded:
libzstd1
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 237 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
[...]
[patrik@patrik-laptop ~]$ sudo apt remove cowsay
[...]
The following packages will be REMOVED:
cowsay
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 93.2 kB disk space will be freed.
Do you want to continue? [Y/n] y
Removing cowsay (3.03+dfsg2-7) ...
[patrik@patrik-laptop ~]$ cowsay test
bash: cowsay: command not found
[patrik@patrik-laptop ~]$
```
<Note type="success" label="Infó">
Ahogy látod, kihagytunk részeket a parancsok kimenetéből.
Ez azért van, mert nem fér bele értelmesen a doksiba.
A videón látható ezek kimenete, de bátran próbáljátok ki ti is.
</Note>
Az `apt update` paranccsal frissíthetjük az apt adatbázisát, mely a
csomagok elérhetőségéről tárol adatokat.
Az `apt search a_csomag_neve` paranccsal a csomagkezelő megkeresi a
hasonló nevű csomagokat és kilistázza azokat.
Az `apt install a_csomag_neve` paranccsal a megadott csomagot telepíti a
csomagkezelő, ha azt megtalálja.
Az `apt upgrade` paranccsal a telepített csomagokhoz elérhető frissítéseket
telepíti a csomagkezelő.
Az `apt remove a_csomag_neve` paranccsal a megadott csomag távolítható el.
### Különböző csomagkezelők
A különböző Linux disztribúciók különböző csomagkezelőket használnak, ilyenek például
az alábbi táblázatban található csomagkezelők is. Néhány csomagkezelő disztribúcióhoz van kötve,
azonban egyre jobban kezdenek elterjedni a disztribúcióktól független csomagkezelők is.
- `apt`: Debian és Ubuntu alapú disztrókon
- `dnf`: Red Hat (alapú) disztrók: Fedora, CentOS, Red Hat Enterprise Linux
- `pacman`: Arch Linux, Manjaro
- `flatpak` és `snap`: disztrófüggetlen, mindenhol működik, ha [feltelepítjük](https://flatpak.org/setup/) egy
disztróspecifikus csomagkezelővel
| parancs | apt | dnf | pacman | snap | flatpak |
|---|---|---|---|---|---|
| telepítés | install | install | -S | install | install |
| adatbázis frissítése | update | check-update | -Sy | automatikus | a frissítéssel együtt ez is megtörténik (update) |
| frissítés | upgrade | upgrade | -Syu | automatikus (ha kézzel akarod: refresh) | update |
| törlés | remove | remove | -R | nincs ilyen | nincs ilyen |
| törlés beállításokkal | purge | nincs ilyen | -Rns | remove | uninstall |
| keresés | search | search | -Ss | find | search |
---
<Note type="danger" label="Légy óvatos">
Itt szó lesz két azonos nevű, de különböző dologról.
- `root` user
- `root` mappa
A kettő teljesen független egymástól, ne keverjük össze.
</Note>
## Hogyan néz ki a Linux fájlrendszere?
UNIX-on a mappastruktúra a `/`-ből indul, ellenben a Windows-zal, ahol a
meghajtók külön betűket kapnak (`C:\ `, `D:\ `, stb).
Emellett UNIX-on a mappaelválasztó a `/`, míg Windows-on a `\ `.
Itt a rendszermeghajtó lesz a `/` <sup>(root, ejtsd: rút)</sup>,
minden mappa innen indul. Erre fel lehet csatolni (`mount`-olni) más meghajtókat is,
tetszőleges mappákba. Például, ha a rendszerünket egy SSD-re telepítjük, majd egy
HDD-t felcsatolunk a `/mnt/HDD` mappába, akkor:
- a `/home/béla/random_file.txt` az SSD-n lesz
- a `/mnt/HDD/cucc/random_file.txt` pedig a merevlemezen lesz
Ennek a megközelítésnek egy nagy előnye, hogy bármit tehetünk bárhova,
például - az előző példát folytatva - ha azt szeretnénk, hogy a fájljaink
a merevlemezen legyenek, de a rendszer és a programok az SSD-n, hogy felcsatoljuk
a merevlemezt a `/home`-ra, így a userek fájljai a merevlemezre kerülnek.
### [Könyvtárak](https://www.linux.com/training-tutorials/linux-filesystem-explained/)
<Note type="tip" label="Megjegyzés">
A fájlrendszer mappastruktúráját nem kell tudni fejből,
elég ha tudod, hogy a konfigurációs fájlokat a `/etc`-ben szokás keresni
és a userek a `/home/<username>` alatt élnek.
</Note>
- `/bin`: "binaries", futtatható programok
- `/boot`: bootloader, kernel és egyéb indításhoz szükséges fájl<sup>erről később lesz szó</sup>
- `/dev`: "devices", eszközök<sup>erről később lesz szó</sup>
- `/etc`: konfigurációs fájlok
- `/home`: userek fájljai
- `/lib`: "libraries", programok futásához szükséges könyvtárak
- `/lib64`: 64 bites `/lib`
- `/mnt`: felcsatolt meghajtók
- `/opt`: "optional programs", néhány program itt él <sup>(olyan programok, amik nem kötődnek a rendszerhez)</sup>
- `/proc`: futó programokról információk<sup>erről később lesz szó</sup>
- `/root`: a [root user](#user-ek-és-groupok) home-ja
- `/run`: rendszerindításonként újraépül, a futó szolgáltatásokhoz való csatlakozásban segít <!-- TODO -->
- `/sbin`: "system binaries", rendszerprogramok
- `/srv`: "servers", a gépen futtatott szerver programok fájljai
- `/sys`: "system", hardvereléréshez kell<sup>erről később lesz szó</sup>
- `/tmp`: "temporary", ideiglenes fájlok, RAM-ban tartva
- `/usr`: "user installed", a telepített csomagok pakolnak ide fájlokat
- `/var`: szolgáltatások tárhelyei
### Speciális "mappák"
- `.`: a jelenlegi mappa
- `././././.`: ez is a jelenlegi mappa, mert a jelenlegi mappa jelenlegi mappájának [...] jelenlegi mappája
- `..`: az egy szinttel feljebb lévő mappa
- `/..` == `/`, root fölé nem lehet menni
- `~`: a mi userünk home mappája
- `~béla`: a `béla` user home mappája
## Jogosultságkezelés
A UNIX permission rendszer elemei:
- user-ek
- group-ok
- módok
Minden fájl és mappa egy user-hez és egy group-hoz tartozik,
vagyis a user és a group annak a fájlnak és mappának a tulajdonosa.
Minden fájlra és mappára meg lehet adni, hogy mi legyen
a módja (továbbiakban permissionjei), ezek:
- `user`: a birtokló user tudja-e:
- `r`: read, olvasni
- `w`: write, írni
- `x`: futtatni (ha fájl) vagy a tartalmát listázni (ha mappa)
- `group`: a birtokló csoport tagjai tudják-e:
- `r`: olvasni
- `w`: írni
- `x`: futtatni vagy listázni
- `others`: bárki más tudja-e:
- `r`: olvasni
- `w`: írni
- `x`: futtatni vagy listázni
<Note type="tip" label="Extra infó">
Van két extra permission, a `setuid` és `setgid`.
Ezekkel meg lehet adni, hogy egy program a tulajdonos nevében
vagy tulajdonos csoport nevében fusson.
Ezt a permission-t használja pár program, amit mindennapi userek
is kell, hogy tudjanak futtatni, de mégis kell valami, csak nagyobb
jogosultsággal elérhető funkció bele.
Ezen kívül van egy ma már nem igazán használt permission is,
a "sticky bit", erről [itt](http://permissions-calculator.org/info/#sticky-bit) olvashatsz.
</Note>
Mindezek számok alapján vannak tárolva,
de a programok okosan feloldják nevekre ezeket.
### User-ek és groupok
Egy user az pont ugyanaz, mint aminek elképzelted,
egy felhasználó, aki tud programokat futtatni.
Egy különleges felhasználó a `root`, ő a főfelhasználó (super-user),
az ő nevében lehet csak a rendszerbeállításokat módosítani,
ez a Windows-os "Rendszergazda" vagy "Adminisztrátor" megfelelője.
Minden userhez tartozik egy ugyanolyan nevű group is, azonban egy
user több groupban is benne lehet.
### Példa a jogosultságokra
Alul látható, hogy hogy néz ki egy listázás `ls`-sel.
A permission-ök user, group, other sorrendben követik egymást.
<Note type="tip" label="Tip">
A különböző fájlokhoz/mappákhoz tartozó magyarázatokat
lenyíló szövegként tettük az oldalra, hogy össze tudd
nézni a magyarázatot és a shell-t.
</Note>
```shell-session
[mike@thinkyboi permissions]$ ls -la -tr
total 0
drwxr-xr-x 3 mike mike 120 Mar 11 13:19 .
drwxrwxrwt 21 root root 640 Mar 11 04:20 ..
-rw-r----- 1 root ftp 0 Mar 11 13:37 egyik
-rw-r--r-- 1 mike daemon 0 Mar 11 13:37 másik
-rwx------ 1 mike mike 0 Mar 11 13:37 harmadik
drwxr-xr-x 2 mike daemon 40 Mar 11 13:37 negyedik
-rwsr-sr-x 1 mike mike 0 Mar 11 13:37 ötödik
```
<details>
<summary>
<code>ls -la -tr</code>
</summary>
- `ls`: fájlokat és mappákat listázó program
- `-la`
- `l`: listaként
- `a`: a `.`-tal kezdődő fájlokat is
- `-tr`
- `t`: idő szerint rendezve
- `r`: visszafelé rendezve
(ezt meg lehetne adni úgy is, hogy `ls -latr`,
de az olvashatóság kedvéért mi külön vettük)
</details>
<details>
<summary>
<code>.</code> (a jelenlegi mappa, vagyis `permissions`, ami a prompt-ból látszik)
</summary>
- `d`: egy mappa
- `rwx`: a birtokos usernek (`mike`) van joga:
- olvasni
- írni
- listázni
- `r-x`: a birtokos csoportnak (szintén `mike`) van joga:
- olvasni
- listázni
- `r-x`: mindenki másnak van joga:
- olvasni
- listázni
- → bárki meglesheti mi van benne, de csak `mike`
tehet bele dolgokat
</details>
<details>
<summary>
<code>..</code> (az eggyel e fölött lévő mappa)
</summary>
- `d`: egy mappa
- `rwx`: `root` user mindent csinálhat vele
- `rwx`: `root` group mindent csinálhat vele
- `rwt`: mindenki más is bármit csinálhat, de mivel a mappa
"sticky", így ha valakinél meg van nyitva valami benne, azt
más nem piszkálhatja
- `t` == `x` + sticky bit
</details>
<details>
<summary>
<code>egyik</code>
</summary>
- egy file (nem `d`-vel kezdődik a permission sor)
- `rw-`: `root` user tudja olvasni és írni
- `r--`: `ftp` csoport tagjai tudják olvasni
- `---`: a többiek nem tudnak semmit csinálni vele
</details>
<details>
<summary>
<code>másik</code>
</summary>
- egy file
- `mike` tudja olvasni és írni
- `daemon` csoport tagja tudják olvasni
- mindenki más is tudja olvasni
</details>
<details>
<summary>
<code>harmadik</code>
</summary>
- egy file
- `mike` tudja írni, olvasni, futtatni
- `x`: mivel lehet futtatni, ez vagy egy program,
vagy hibát dob, ha megpróbáljuk futtatni
</details>
<details>
<summary>
<code>negyedik</code>
</summary>
- egy mappa
- mindenki tudja olvasni és listázni, de csak `mike` tud benne
fájlt létrehozni
</details>
<details>
<summary>
<code>ötödik</code>
</summary>
- `rws`: `mike` tudja futtani, és ha futtatva van bárki által,
akkor is `mike` usere nevében fut
- `s` == `x` + setuid
- `r-s`: `mike` csoport tagjai tudják olvasni és futtatni, és
ha bárki futtatja, akkor is kap `mike` csoporttagságot a program
- `r-x`: bárki futtathatja
- → bárki olvashatja és futtathatja, és ha futtatja, akkor
`mike` nevében fog futni a program
</details>
### Jogosultságok megváltoztatása
Vannak különböző parancsok, melyek segítségével megváltoztathatjuk mind a user-ek,
mind a group-ok, mind a többi felhasználó jogosultságait, sőt megváltoztathatjuk a
tulajdonosokat is.
#### `chmod`
Segítségével megváltoztathatjuk az állományok hozzáférési jogait (change mode).
Ha nem a saját fájljaink, mappáink jogait szeretnénk módosítani, ahhoz `sudo` is kell.
Ehhez megadjuk a `chmod` után, hogy kire vonatkozzon (user, group, others),
megadjuk, hogy hozzáférést szeretnénk-e adni vagy elvenni akarjuk azt,
valamint magát az állományt. A különböző paraméterek a következőek:
`u` - user, a birtokló user
`g` - group, a birtokló csoport tagjai
`o` - others, bárki más
`+` hozzáad egy jogot
`-` eltávolítja a jogot
`r` - read, olvasási jog
`w` - write, írási jog
`x` - execute, végrehajtási jog
Például:
`chmod u+x <fájlnév vagy mappanév>` itt a user kap listázási vagy futtatási jogot.
`chmod g-w <fájlnév vagy mappanév>` itt a group-nak szűnik meg az írási joga
Ugyanezen konvenció alapján működik mindegyik parancs.
Kicsit szemléletesebben:
```
patrik@ubuntu:~/Documents$ ls -la
total 8
drwxr-xr-x 2 patrik patrik 4096 Mar 18 19:38 .
drwxr-xr-x 15 patrik patrik 4096 Mar 17 16:20 ..
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 linux.pdf
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 pálinka.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:38 pörkölt.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 randomsorok.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 recept.txt
patrik@ubuntu:~/Documents$ chmod o+w pörkölt.txt
patrik@ubuntu:~/Documents$ ls -la
total 8
drwxr-xr-x 2 patrik patrik 4096 Mar 18 19:38 .
drwxr-xr-x 15 patrik patrik 4096 Mar 17 16:20 ..
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 linux.pdf
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 pálinka.txt
-rw-rw-rw- 1 patrik patrik 0 Mar 18 19:38 pörkölt.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 randomsorok.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 recept.txt
patrik@ubuntu:~/Documents$
```
Itt a `chmod o+w pörkölt.txt` parancs segítségével mások kapnak írási jogot
a pörkölt.txt fájlhoz, ami eddig nem volt nekik.
A `-rw-rw-r--` megváltozott `-rw-rw-rw-` -ra.
Az others-re az utolsó három karakter vonatkozik, ezek közül
a második változott meg, míg eddig egy `-` jel volt, vagyis nincs joga hozzá,
most pedig `w` lett, vagyis van hozzá joga.
Ha egyszerre szeretnénk jogot adni a user-nek, group-nak, others-nek vagy elvenni,
valamint ha többféle joggal szeretnénk ezt, akkor több paramétert is megadhatunk egy parancsban.
Ezt kétféleképpen is megtehetjük:
- `chmod` `u` `g` `o` közül a kiválasztottak `+` vagy `-` az `r` `w` `x` közül a
kiválasztottak. Vagyis a bal oldalra írjuk kinek a jogait szeretnénk módosítani,
középre, hogy elvenni vagy adni szeretnénk, jobb oldalra pedig, hogy mely jogokat.
```
patrik@ubuntu:~/Documents$ chmod ug-rw pörkölt.txt
patrik@ubuntu:~/Documents$ ls -la
total 8
drwxr-xr-x 2 patrik patrik 4096 Mar 18 19:38 .
drwxr-xr-x 15 patrik patrik 4096 Mar 17 16:20 ..
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 linux.pdf
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 pálinka.txt
-------rw- 1 patrik patrik 0 Mar 18 19:38 pörkölt.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 randomsorok.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 recept.txt
patrik@ubuntu:~/Documents$
```
- Másik módja, hogy a különböző műveleteket vesszővel elválasztva adjuk meg.
```
patrik@ubuntu:~/Documents$ chmod u+rw,g+r,o-rw pörkölt.txt
patrik@ubuntu:~/Documents$ ls -la
total 8
drwxr-xr-x 2 patrik patrik 4096 Mar 18 19:38 .
drwxr-xr-x 15 patrik patrik 4096 Mar 17 16:20 ..
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 linux.pdf
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 pálinka.txt
-rw-r----- 1 patrik patrik 0 Mar 18 19:38 pörkölt.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 randomsorok.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 recept.txt
patrik@ubuntu:~/Documents$
```
#### `chown`
Segítségével megváltoztatható az állományok tulajdonosa
(a change the owner rövidítése).
Egy fájl vagy mappa tulajdonosának megváltoztatásához `sudo` jog kell.
```
patrik@ubuntu:~/Documents$ sudo chown mike recept.txt
[sudo] password for patrik:
patrik@ubuntu:~/Documents$ ls -la
total 8
drwxr-xr-x 2 patrik patrik 4096 Mar 18 19:38 .
drwxr-xr-x 15 patrik patrik 4096 Mar 17 16:20 ..
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 linux.pdf
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 pálinka.txt
-rw-r----- 1 patrik patrik 0 Mar 18 19:38 pörkölt.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 randomsorok.txt
-rw-rw-r-- 1 mike patrik 0 Mar 18 19:37 recept.txt
patrik@ubuntu:~/Documents$
```
#### `chgrp`
A parancs lehetőséget ad arra, egy fájl vagy mappa csoportját megváltoztassuk
(a change group rövidítése).
Normál felhasználó akkor módosíthatja a fájl vagy mappa csoportját,
ha a régi és új csoportnak is tagja, ellenkező esetben a `sudo` parancs is szükséges.
```
patrik@ubuntu:~/Documents$ sudo chgrp mike recept.txt
patrik@ubuntu:~/Documents$ ls -la
total 8
drwxr-xr-x 2 patrik patrik 4096 Mar 18 19:38 .
drwxr-xr-x 15 patrik patrik 4096 Mar 17 16:20 ..
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 linux.pdf
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 pálinka.txt
-rw-r----- 1 patrik patrik 0 Mar 18 19:38 pörkölt.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 randomsorok.txt
-rw-rw-r-- 1 mike mike 0 Mar 18 19:37 recept.txt
patrik@ubuntu:~/Documents$
```
<Note type="tip" label="Tip">
A csoportot nem csak az előbbi `chgrp` paranccsal lehet módosítani, hanem
a `chown` paranccsal is.
Ehhez a következőt kell tenni:
`sudo chown username:groupname fájl`
```shell-session
patrik@ubuntu:~/Documents$ ls -la
total 8
drwxr-xr-x 2 patrik patrik 4096 Mar 19 19:18 .
drwxr-xr-x 15 patrik patrik 4096 Mar 17 16:20 ..
-rw-r----- 1 patrik patrik 0 Mar 18 19:38 pörkölt.txt
-rw-rw-r-- 1 mike mike 0 Mar 18 19:37 recept.txt
patrik@ubuntu:~/Documents$ sudo chown patrik:patrik recept.txt
[sudo] password for patrik:
patrik@ubuntu:~/Documents$ ls -la
total 8
drwxr-xr-x 2 patrik patrik 4096 Mar 19 19:18 .
drwxr-xr-x 15 patrik patrik 4096 Mar 17 16:20 ..
-rw-r----- 1 patrik patrik 0 Mar 18 19:38 pörkölt.txt
-rw-rw-r-- 1 patrik patrik 0 Mar 18 19:37 recept.txt
patrik@ubuntu:~/Documents$
```
</Note>