You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

360 lines
13 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  5. <head>
  6. <!-- 2023-03-30 Thu 21:34 -->
  7. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1" />
  9. <title>Lab9 Solution Amirlan Sharipov (BS21-CS-01)</title>
  10. <meta name="author" content="Amirlan Sharipov (BS21-CS-01)" />
  11. <meta name="generator" content="Org Mode" />
  12. <style>
  13. #content { max-width: 60em; margin: auto; }
  14. .title { text-align: center;
  15. margin-bottom: .2em; }
  16. .subtitle { text-align: center;
  17. font-size: medium;
  18. font-weight: bold;
  19. margin-top:0; }
  20. .todo { font-family: monospace; color: red; }
  21. .done { font-family: monospace; color: green; }
  22. .priority { font-family: monospace; color: orange; }
  23. .tag { background-color: #eee; font-family: monospace;
  24. padding: 2px; font-size: 80%; font-weight: normal; }
  25. .timestamp { color: #bebebe; }
  26. .timestamp-kwd { color: #5f9ea0; }
  27. .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
  28. .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
  29. .org-center { margin-left: auto; margin-right: auto; text-align: center; }
  30. .underline { text-decoration: underline; }
  31. #postamble p, #preamble p { font-size: 90%; margin: .2em; }
  32. p.verse { margin-left: 3%; }
  33. pre {
  34. border: 1px solid #e6e6e6;
  35. border-radius: 3px;
  36. background-color: #f2f2f2;
  37. padding: 8pt;
  38. font-family: monospace;
  39. overflow: auto;
  40. margin: 1.2em;
  41. }
  42. pre.src {
  43. position: relative;
  44. overflow: auto;
  45. }
  46. pre.src:before {
  47. display: none;
  48. position: absolute;
  49. top: -8px;
  50. right: 12px;
  51. padding: 3px;
  52. color: #555;
  53. background-color: #f2f2f299;
  54. }
  55. pre.src:hover:before { display: inline; margin-top: 14px;}
  56. /* Languages per Org manual */
  57. pre.src-asymptote:before { content: 'Asymptote'; }
  58. pre.src-awk:before { content: 'Awk'; }
  59. pre.src-authinfo::before { content: 'Authinfo'; }
  60. pre.src-C:before { content: 'C'; }
  61. /* pre.src-C++ doesn't work in CSS */
  62. pre.src-clojure:before { content: 'Clojure'; }
  63. pre.src-css:before { content: 'CSS'; }
  64. pre.src-D:before { content: 'D'; }
  65. pre.src-ditaa:before { content: 'ditaa'; }
  66. pre.src-dot:before { content: 'Graphviz'; }
  67. pre.src-calc:before { content: 'Emacs Calc'; }
  68. pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
  69. pre.src-fortran:before { content: 'Fortran'; }
  70. pre.src-gnuplot:before { content: 'gnuplot'; }
  71. pre.src-haskell:before { content: 'Haskell'; }
  72. pre.src-hledger:before { content: 'hledger'; }
  73. pre.src-java:before { content: 'Java'; }
  74. pre.src-js:before { content: 'Javascript'; }
  75. pre.src-latex:before { content: 'LaTeX'; }
  76. pre.src-ledger:before { content: 'Ledger'; }
  77. pre.src-lisp:before { content: 'Lisp'; }
  78. pre.src-lilypond:before { content: 'Lilypond'; }
  79. pre.src-lua:before { content: 'Lua'; }
  80. pre.src-matlab:before { content: 'MATLAB'; }
  81. pre.src-mscgen:before { content: 'Mscgen'; }
  82. pre.src-ocaml:before { content: 'Objective Caml'; }
  83. pre.src-octave:before { content: 'Octave'; }
  84. pre.src-org:before { content: 'Org mode'; }
  85. pre.src-oz:before { content: 'OZ'; }
  86. pre.src-plantuml:before { content: 'Plantuml'; }
  87. pre.src-processing:before { content: 'Processing.js'; }
  88. pre.src-python:before { content: 'Python'; }
  89. pre.src-R:before { content: 'R'; }
  90. pre.src-ruby:before { content: 'Ruby'; }
  91. pre.src-sass:before { content: 'Sass'; }
  92. pre.src-scheme:before { content: 'Scheme'; }
  93. pre.src-screen:before { content: 'Gnu Screen'; }
  94. pre.src-sed:before { content: 'Sed'; }
  95. pre.src-sh:before { content: 'shell'; }
  96. pre.src-sql:before { content: 'SQL'; }
  97. pre.src-sqlite:before { content: 'SQLite'; }
  98. /* additional languages in org.el's org-babel-load-languages alist */
  99. pre.src-forth:before { content: 'Forth'; }
  100. pre.src-io:before { content: 'IO'; }
  101. pre.src-J:before { content: 'J'; }
  102. pre.src-makefile:before { content: 'Makefile'; }
  103. pre.src-maxima:before { content: 'Maxima'; }
  104. pre.src-perl:before { content: 'Perl'; }
  105. pre.src-picolisp:before { content: 'Pico Lisp'; }
  106. pre.src-scala:before { content: 'Scala'; }
  107. pre.src-shell:before { content: 'Shell Script'; }
  108. pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
  109. /* additional language identifiers per "defun org-babel-execute"
  110. in ob-*.el */
  111. pre.src-cpp:before { content: 'C++'; }
  112. pre.src-abc:before { content: 'ABC'; }
  113. pre.src-coq:before { content: 'Coq'; }
  114. pre.src-groovy:before { content: 'Groovy'; }
  115. /* additional language identifiers from org-babel-shell-names in
  116. ob-shell.el: ob-shell is the only babel language using a lambda to put
  117. the execution function name together. */
  118. pre.src-bash:before { content: 'bash'; }
  119. pre.src-csh:before { content: 'csh'; }
  120. pre.src-ash:before { content: 'ash'; }
  121. pre.src-dash:before { content: 'dash'; }
  122. pre.src-ksh:before { content: 'ksh'; }
  123. pre.src-mksh:before { content: 'mksh'; }
  124. pre.src-posh:before { content: 'posh'; }
  125. /* Additional Emacs modes also supported by the LaTeX listings package */
  126. pre.src-ada:before { content: 'Ada'; }
  127. pre.src-asm:before { content: 'Assembler'; }
  128. pre.src-caml:before { content: 'Caml'; }
  129. pre.src-delphi:before { content: 'Delphi'; }
  130. pre.src-html:before { content: 'HTML'; }
  131. pre.src-idl:before { content: 'IDL'; }
  132. pre.src-mercury:before { content: 'Mercury'; }
  133. pre.src-metapost:before { content: 'MetaPost'; }
  134. pre.src-modula-2:before { content: 'Modula-2'; }
  135. pre.src-pascal:before { content: 'Pascal'; }
  136. pre.src-ps:before { content: 'PostScript'; }
  137. pre.src-prolog:before { content: 'Prolog'; }
  138. pre.src-simula:before { content: 'Simula'; }
  139. pre.src-tcl:before { content: 'tcl'; }
  140. pre.src-tex:before { content: 'TeX'; }
  141. pre.src-plain-tex:before { content: 'Plain TeX'; }
  142. pre.src-verilog:before { content: 'Verilog'; }
  143. pre.src-vhdl:before { content: 'VHDL'; }
  144. pre.src-xml:before { content: 'XML'; }
  145. pre.src-nxml:before { content: 'XML'; }
  146. /* add a generic configuration mode; LaTeX export needs an additional
  147. (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
  148. pre.src-conf:before { content: 'Configuration File'; }
  149. table { border-collapse:collapse; }
  150. caption.t-above { caption-side: top; }
  151. caption.t-bottom { caption-side: bottom; }
  152. td, th { vertical-align:top; }
  153. th.org-right { text-align: center; }
  154. th.org-left { text-align: center; }
  155. th.org-center { text-align: center; }
  156. td.org-right { text-align: right; }
  157. td.org-left { text-align: left; }
  158. td.org-center { text-align: center; }
  159. dt { font-weight: bold; }
  160. .footpara { display: inline; }
  161. .footdef { margin-bottom: 1em; }
  162. .figure { padding: 1em; }
  163. .figure p { text-align: center; }
  164. .equation-container {
  165. display: table;
  166. text-align: center;
  167. width: 100%;
  168. }
  169. .equation {
  170. vertical-align: middle;
  171. }
  172. .equation-label {
  173. display: table-cell;
  174. text-align: right;
  175. vertical-align: middle;
  176. }
  177. .inlinetask {
  178. padding: 10px;
  179. border: 2px solid gray;
  180. margin: 10px;
  181. background: #ffffcc;
  182. }
  183. #org-div-home-and-up
  184. { text-align: right; font-size: 70%; white-space: nowrap; }
  185. textarea { overflow-x: auto; }
  186. .linenr { font-size: smaller }
  187. .code-highlighted { background-color: #ffff00; }
  188. .org-info-js_info-navigation { border-style: none; }
  189. #org-info-js_console-label
  190. { font-size: 10px; font-weight: bold; white-space: nowrap; }
  191. .org-info-js_search-highlight
  192. { background-color: #ffff00; color: #000000; font-weight: bold; }
  193. .org-svg { }
  194. </style>
  195. </head>
  196. <body>
  197. <div id="content" class="content">
  198. <h1 class="title">Lab9 Solution Amirlan Sharipov (BS21-CS-01)</h1>
  199. <div id="table-of-contents" role="doc-toc">
  200. <h2>Table of Contents</h2>
  201. <div id="text-table-of-contents" role="doc-toc">
  202. <ul>
  203. <li><a href="#org21d542a">1. Question 1</a></li>
  204. <li><a href="#org3b74767">2. Question 2</a></li>
  205. <li><a href="#org8d3c3fc">3. Question 3</a></li>
  206. <li><a href="#org469c55f">4. Question 4</a></li>
  207. <li><a href="#orgdfe38ae">5. Question 5</a>
  208. <ul>
  209. <li><a href="#org9953654">5.1. Add gpg atom&rsquo;s gpg keys</a></li>
  210. <li><a href="#org8291486">5.2. Add atom&rsquo;s repository to sources list</a></li>
  211. <li><a href="#orgef945fa">5.3. Dowload packages information from all sources</a></li>
  212. <li><a href="#org3bb35d0">5.4. Search for atom</a></li>
  213. <li><a href="#org232fa14">5.5. Finally install atom</a></li>
  214. </ul>
  215. </li>
  216. <li><a href="#orgb6f9c6c">6. Question 6</a></li>
  217. </ul>
  218. </div>
  219. </div>
  220. <div id="outline-container-org21d542a" class="outline-2">
  221. <h2 id="org21d542a"><span class="section-number-2">1.</span> Question 1</h2>
  222. <div class="outline-text-2" id="text-1">
  223. <p>
  224. One of the alternative is to use GPS-based ntp and sync time with the satellites.
  225. </p>
  226. </div>
  227. </div>
  228. <div id="outline-container-org3b74767" class="outline-2">
  229. <h2 id="org3b74767"><span class="section-number-2">2.</span> Question 2</h2>
  230. <div class="outline-text-2" id="text-2">
  231. <p>
  232. Use one server as an ntp client and another as an ntp server and sync them regularly using cron.
  233. </p>
  234. </div>
  235. </div>
  236. <div id="outline-container-org8d3c3fc" class="outline-2">
  237. <h2 id="org8d3c3fc"><span class="section-number-2">3.</span> Question 3</h2>
  238. <div class="outline-text-2" id="text-3">
  239. <p>
  240. apt is a new command-line interface aimer for interactive usage.
  241. apt is a high-level tool to interact with tools like apt-get and apt-cache.
  242. </p>
  243. </div>
  244. </div>
  245. <div id="outline-container-org469c55f" class="outline-2">
  246. <h2 id="org469c55f"><span class="section-number-2">4.</span> Question 4</h2>
  247. <div class="outline-text-2" id="text-4">
  248. <p>
  249. upgrade only upgrades the packages and never removes them, whereas full-upgrade may result in removal of some packages. This may cause problems for system administrators.
  250. </p>
  251. </div>
  252. </div>
  253. <div id="outline-container-orgdfe38ae" class="outline-2">
  254. <h2 id="orgdfe38ae"><span class="section-number-2">5.</span> Question 5</h2>
  255. <div class="outline-text-2" id="text-5">
  256. <p>
  257. The information is taken from <a href="https://linuxhint.com/install-atom-text-editor-ubuntu-22-04/">https://linuxhint.com/install-atom-text-editor-ubuntu-22-04/</a>
  258. I am very skeptical about this method. Atom is deprecated. As well as apt-key. But it works
  259. </p>
  260. </div>
  261. <div id="outline-container-org9953654" class="outline-3">
  262. <h3 id="org9953654"><span class="section-number-3">5.1.</span> Add gpg atom&rsquo;s gpg keys</h3>
  263. <div class="outline-text-3" id="text-5-1">
  264. <p>
  265. wget -qO - <a href="https://packagecloud.io/AtomEditor/atom/gpgkey">https://packagecloud.io/AtomEditor/atom/gpgkey</a> | sudo apt-key add -
  266. </p>
  267. </div>
  268. </div>
  269. <div id="outline-container-org8291486" class="outline-3">
  270. <h3 id="org8291486"><span class="section-number-3">5.2.</span> Add atom&rsquo;s repository to sources list</h3>
  271. <div class="outline-text-3" id="text-5-2">
  272. <p>
  273. sudo sh -c &rsquo;echo &ldquo;deb [arch=amd64] <a href="https://packagecloud.io/AtomEditor/atom/any/">https://packagecloud.io/AtomEditor/atom/any/</a> any main&rdquo; &gt; /etc/apt/sources.list.d/atom.list&rsquo;
  274. </p>
  275. </div>
  276. </div>
  277. <div id="outline-container-orgef945fa" class="outline-3">
  278. <h3 id="orgef945fa"><span class="section-number-3">5.3.</span> Dowload packages information from all sources</h3>
  279. <div class="outline-text-3" id="text-5-3">
  280. <p>
  281. sudo apt update
  282. </p>
  283. </div>
  284. </div>
  285. <div id="outline-container-org3bb35d0" class="outline-3">
  286. <h3 id="org3bb35d0"><span class="section-number-3">5.4.</span> Search for atom</h3>
  287. <div class="outline-text-3" id="text-5-4">
  288. <p>
  289. apt search atom
  290. There was a huge output with atom in it.
  291. </p>
  292. </div>
  293. </div>
  294. <div id="outline-container-org232fa14" class="outline-3">
  295. <h3 id="org232fa14"><span class="section-number-3">5.5.</span> Finally install atom</h3>
  296. <div class="outline-text-3" id="text-5-5">
  297. <p>
  298. sudo apt install atom
  299. </p>
  300. </div>
  301. </div>
  302. </div>
  303. <div id="outline-container-orgb6f9c6c" class="outline-2">
  304. <h2 id="orgb6f9c6c"><span class="section-number-2">6.</span> Question 6</h2>
  305. <div class="outline-text-2" id="text-6">
  306. <div class="org-src-container">
  307. <pre class="src src-bash"><span style="color: #c792ea;">cat</span> control create-package.sh
  308. </pre>
  309. </div>
  310. <pre class="example" id="orge68b8fa">
  311. Package: hellopackage
  312. Version: 1.0
  313. Architecture: all
  314. Maintainer: RinRi
  315. Depends: python3
  316. Description: Hello world
  317. #!/bin/bash
  318. rm -rf hellopackage
  319. mkdir -p hellopackage hellopackage/usr/local/bin hellopackage/var/helloworld
  320. printf "%s" '#!/usr/bin/env python3\nprint("Hello, World!")' &gt; hellopackage/var/helloworld/helloworld.py
  321. printf "%s" '#!/bin/bash\n/var/helloworld/helloworld.py' &gt; hellopackage/usr/local/bin/helloworld
  322. chmod -R 0755 hellopackage/var/helloworld hellopackage/usr/local/bin/helloworld
  323. mkdir -p hellopackage/DEBIAN
  324. cp control hellopackage/DEBIAN/
  325. dpkg-deb --build --root-owner-group hellopackage
  326. </pre>
  327. <p>
  328. After this just use sudo apt install ./hellopackage.deb and everything works.
  329. </p>
  330. <div id="orgf4ac92c" class="figure">
  331. <p><img src="./lab9-image-01.jpg" alt="lab9-image-01.jpg" />
  332. </p>
  333. </div>
  334. <p>
  335. The artifacts created by the package are the same as in the image but from the root directory.
  336. </p>
  337. </div>
  338. </div>
  339. </div>
  340. <div id="postamble" class="status">
  341. <p class="author">Author: Amirlan Sharipov (BS21-CS-01)</p>
  342. <p class="date">Created: 2023-03-30 Thu 21:34</p>
  343. </div>
  344. </body>
  345. </html>