ubuntu notes

Table of Contents

1 backup data

CHAPTER 32 Backing Up Data, Keir Thomas, Beginning Ubuntu linux

packages:

  1. Simple Backup Suite (SBackup
  2. tar

2 Basics Ubuntu

extract .tar.gz file in Ubuntu

Compress an Entire Directory or a Single File

tar cvzf example.tar.gz /path/to/directory -c: Create an archive -z: Compress the archive with g*z*ip -v: dispaly progress in the terminal -f: specify the *f*ilename of the archive

Extract an Archive

tar -xzvf archive.tar.gz

cutting, copying and pasting in terminal Ubuntu X #cutting C # copying Ctrl+Shift+V #pasting

3 Install, uninstall packages

sudo apt-get install packagename

sudo apt-get remove packagename

sudo apt-get purge packagename #remove package and dependencies

https://www.wikihow.com/Uninstall-Ubuntu-Software

4 Basic Unix

  • pwd #print Working Directory
  • ls #prints filenames in a list
  • ls -a #prints all filenames, including hidden files
  • ls -l #'long' list, displays info including permissions.
  • ls -h #prints the sizes of files in units you can read
  • ls -tr #t for time sorted, r for reverse
  • cd ~/ # return to home directory
  • cd ../ # move up one directory
  • mkdir [foldername] # make directory

5 Glossary

PPA
personal package archives

6 FAQ

 

6.1 sudo: unable to resolve host 127.0.0.1localhost

solution:

$ vim /etc/hostname
Ubuntu
$ vim /etc/hosts
127.0.0.1 localhost Ubuntu

6.2 check packages installed

use dpkg , a package manager for Ubuntu

To check a specified package:

$ dpkg -s [package name]

To list all packages:

$ dpkg-query -l

6.3 Ubuntu on lenovo ideapad 100s

default windows, UEFI, only allow to disable secure boot,

  • do not have BIOS compatibility mode
  • Turn off the machine
  • Press the recovery button next to the HDD light.
  • Select BIOS Setup
  • In configuration, turn off Secure boot, select Reset to Setup Mode.
  • Press F10 to save and exit.
  • Turn off the machine again, press the recovery button.
  • Select Boot Menu
  • Select Ubuntu under EFI Boot Devices.

6.3.1 system does not have any USB boot option, please select other boot option in Boot manager menu

6.4 killing unnecessary processes

keywords: background process, kill

To list all processes:

  • ps -ef

From the terminal, ps -ef will list all the processes. See man ps. See man kill, man 2 kill, man killall, man nice, man pkill, man renice, man 7 signal, and man skill to mess with processes. However, simply killing a process that you think is useless may be a mistake. The system might restart the process, or something you depend on might depend on the process you killed. Learn what the processes do, and look at etc/init and /etc/init.d, /etc/rc?.d, man service to see how processes are started by the system.

6.5 Image Converter

change image format

eps to pdf > epstopdf package > epstopdf [options] [epsfile]

6.6 images to video

use avconv

syntax:

avconv [global options] [[infile options][‘-i’ infile]]... {[outfile options] outfile}

e.g.

avconv -r 10 -startnumber 8 -i filename_%d.png -b:v 1000k test.mp4

avconv -i v_%d.png -b:v 1000k velocity.mp4

i
input file
b
bitrate

https://libav.org/avconv.html https://stackoverflow.com/questions/16315192/avconv-make-a-video-from-a-subset-on-images

7 screen recording on Ubuntu

7.0.1 byzanz

To record full screen on a 24 inch monitor:

$byzanz-record --duration=10 -c --width=1920 --height=1080 test1.gif

  • 1080p=1920*1080
  • coordinates start from the left corner

byzanz-record -d 20 -c -x 0 -y 0 -w 700 -h 550 -v out.gif

where -d : duration : 20 seconds to be recorded -c : cursor also to be recorded -x : left co-ordinate of the recording rectangle -y : right co-ordinate of the recording rectangle -w : width of the recoding rectangle -h : height of the recording rectangle -v : verbose output out.gif : output file name

To launch a terminal $ byzanz-record –help

which returns:

*************
Usage:
byzanz-record [OPTION...] record your current desktop session Help Options:
-?, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options Application Options:
-d, --duration=SECS Duration of animation (default: 10 seconds)
--delay=SECS Delay before start (default: 1 second)
-l, --loop Let the animation loop
-c, --cursor Record mouse cursor
-x, --x=PIXEL X coordinate of rectangle to record
-y, --y=PIXEL Y coordinate of rectangle to record
-w, --width=PIXEL Width of recording rectangle
-h, --height=PIXEL Height of recording rectangle
-v, --verbose Be verbose
--display=DISPLAY X display to use
****************

Three shell scripts:

  1. byzanz-record-window –> to select a window for recording
  2. byzanz-record-region –> to select a part of the screen for recording
  3. a simple GUI front-end for 1, by MHC

https://askubuntu.com/questions/107726/how-to-create-animated-gif-images-of-a-screencast/

https://wiki.ubuntu.com/CreatingScreencasts

8 Packages

To check xxPackage installation path

dpkg -L <packagename>

the terminal responding as:

/usr/lib/paraview/

8.1 extract a page from a multiple pages pdf

use pdftk package

pdftk full-pages.pdf cat 1 output outfile_1.pdf

in the above command, input file is full-pages.pdf, you extract page 1 and save it as outfile_1.pdf

8.3 Light Ubuntu OS

linux lite

Lubuntu

8.4 Python

sudo add-apt-repository ppa:deadsnakes/ppa

sudo apt-get update

sudo apt-get install python3.6

https://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get

8.5 Octave: matlab alternative

8.6 video Download

you-get package To upgrade you-get: > $ pip3 install –upgrade you-get

e.g.

$ you-get -i 'https://www.youtube.com/watch?v=jNQXAC9IVRw'

then you can see all formats and their corresponding tags, download a specified video format.

$ you-get –itag=18 'https://www.youtube.com/watch?v=jNQXAC9IVRw'

8.8 PDF viewer

Okular set default pdf viewer

8.9 Tor Browser on Ubuntu 16.04

sudo add-apt-repository ppa:webupd8team/tor-browser

sudo apt-get update

sudo apt-get install tor-browser https://www.linuxbabe.com/desktop-linux/install-tor-browser-on-ubuntu-16-04-via-ppa

8.10 Thunderbird

 

8.10.1 office 365

8.10.2 add Gmail account to thunderbird

  1. first enable IMAP on your Gmail account. See Gmail's instructions for help. (IMAP is enabled on new Gmail accounts by default.)

    On your computer, open Gmail. In the top right, click Settings Settings. Click Settings. Click the Forwarding and POP/IMAP tab. In the "IMAP Access" section, select Enable IMAP. Click Save Changes.

  2. Step 2: Change SMTP & other settings in your email client

File > New > Existing Mail Account

The "Mail Account Setup" dialog is displayed. After you provide your account information (real name, email address and password), Thunderbird will automatically configure your Gmail connection. Click Done, sign in with your Google account if prompted and that's all! Thunderbird will download your existing messages and your Gmail will be ready to use.

Use the table below to update your client with the correct information. For help updating your settings, search your email client's Help Center for instructions on setting up IMAP.

Incoming Mail (IMAP) Server:

imap.gmail.com

Requires SSL: Yes

Port: 993

Outgoing Mail (SMTP) Server

smtp.gmail.com

Requires SSL: Yes

Requires TLS: Yes (if available)

Requires Authentication: Yes

Port for SSL: 465

Port for TLS/STARTTLS: 587 Full Name or Display Name Your name Account Name, User name, or Email address Your full email address Password Your Gmail password

https://support.mozilla.org/en-US/kb/thunderbird-and-gmail

8.11 To set up Thunderbird to sync to your Outlook.com account’s email:

  1. Open Thunderbird.
  2. From the Application menu, choose Add Account…
  3. Input your account information, choose Options… then Account Settings…
  4. Click the Account Actions button, then choose Add Mail Account…
  5. Input your account information.
  6. Click Continue.
  7. Click Manual config.
  8. Set the Incoming settings as follows:

    a. Server hostname: imap-mail.outlook.com. (smtp.office365.com)

    b. Port: 993.

    c. SSL: SSL/TLS.

    d. Authentication: Normal password.

  1. Set the Outgoing settings as follows:

    a. Server hostname: smtp-mail.outlook.com. (smtp.office365.com)

    b. Port: 587.

    c. SSL: STARTTLS.

    d. Authentication: Normal password.

  1. Click Done.

For more information on connecting your app to Outlook.com, visit this link: http://windows.microsoft.com/en-us/windows/outlook/send-receive-from-app.

8.12 Outlook 365

  1. Start your Thunderbird client.
  2. Go to Tools and then Account Settings
  3. Select Account Actions and then Add Mail Account…
  4. Enter Your name and your QMUL Email address (eg qm.staff@qmul.ac.uk) and QMUL Password.
  5. Don’t forget to tick the Remember password option before clicking Continue.
  6. If successful you will be able to click Done to complete the email set up and start using your account.
  7. Thunderbird may not automatically find the settings and the following error message will appear:

'Thunderbird failed to find the settings for your email account.'

  1. Amend Incoming IMAP server hostname to ‘outlook.office365.com’ and Outgoing SMTP to ‘smtp.office365.com’.
  2. Change the Incoming port to 993 and the Outgoing port to 587.
  3. Change the Incoming SSL to ‘SSL/TLS’ and the Authentication to ‘Normal Password’, and the Outgoing SSL to ‘Autodetect’ and Authentication to ‘Autodetect’.
  4. Amend the entry for Username to your QMUL username including the '@qmul.ac.uk' suffix (eg abc123@qmul.ac.uk).
  5. Click Re-Test.

13 .Click Done to complete the email set up and start using your account.

http://www.its.qmul.ac.uk/support/self-help/email_setup/settingupemail/thunderbird/

9 Update

sudo apt update && sudo apt upgrade

10 Chinese input

 

10.1 fcitx

  1. install fcitx

sudo apt install fcitx fcitx-googlepinyin

  1. After that, launch Language Support utility and select use Fcitx:
  2. Finally restart your computer and you’ll see a keyboard icon in panel. Go to Configure (see menu in the top picture) and do:

    click the bottom left plus icon. uncheck “show current language” scroll down and choose an IM you want finally click OK.

10.2 Sougou input

Install fcitx > sudo apt install fcitx fcitx-googlepinyin fcitx-table-wbpy fcitx-pinyin fcitx-sunpinyin

http://ubuntuhandbook.org/index.php/2016/07/2-best-chinese-pinyin-im-ubuntu-16-04/

11 Resilio sync

 

11.2 reset my WebUI password

To reset login and password settings, follow these steps:

  1. Quit Sync and close WebUI.
  2. Go to the Sync storage folder Linux packages:

var/lib/resilio-sync if launched as default rslsync user. /home/username.config/resilio-sync/storage if launched as current user.

  1. Locate and remove the following files:

settings.dat settings.dat.old

  1. Once the files are removed, restart Sync, open WebUI and enter your new login and password.

12 Commands

chmod
is the command and system call which may change the access permissions to file system objects.
systemctl
Control the systemd system and service manager

12.1 make

make
a build automation tool that automatically builds

executable programs and libraries from source code

13 Package Manager

 

13.1 dpkg

dpkg
a package manager for Debian-based systems.

It can install, remove, and build packages, but unlike other package management systems, it cannot automatically download and install packages or their dependencies.

(no term)
you can install a local .deb ile by entering:

sudo dpkg -i example.deb

Change=example.deb=to the actual file name of the local .deb file you wish to install.

2 . Uninstalling a package can be accomplished by:

sudo dpkg -r zip

Uninstalling packages using dpkg, in most cases, is NOT recommended. It is better to use a package manager that handles dependencies to ensure that the system is in a consistent state. For example using dpkg -r zip will remove the zip package, but any packages that depend on it will still be installed and may no longer function correctly.

https://help.ubuntu.com/lts/serverguide/dpkg.html.en

14 BEM code

 

14.1 compiling

>f95 waketudk.f dynaero.f #compile TUDK model >f95 wakegh.f dynaero.f # GH model

15 Introduction

16 update

sudo apt-get update # Fetches the list of available updates sudo apt-get upgrade # Strictly upgrades the current packages sudo apt-get dist-upgrade # Installs updates (new ones)

17 Resilio sync

https://www.linuxbabe.com/ubuntu/install-resilio-sync-ubuntu-16-04-16-10

Installing Resilio Sync on Ubuntu 16.04 and Ubuntu 16.10 via Official Repository

Open up a terminal window and edit the sources.list file with nano or your preferred text editor.

>> sudo nano /etc/apt/sources.list

Append the following APT line at the end of this file.

>> deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free Save and close the file.

In order for APT to authenticate packages from the above repository, we need to import Resilio Sync’s public key. First download the public key with wget.

>> wget https://linux-packages.resilio.com/resilio-sync/key.asc

Then import the public key with apt-key.

>> sudo apt-key add key.asc

update local package index and install Resilio Sync.

>> sudo apt update

>> sudo apt install resilio-sync

Managing Resilio Sync

To start Resilio Sync, use systemctl command.

sudo systemctl start resilio-sync

And enable auto start at boot time using the following command:

sudo systemctl enable resilio-sync

Check its status.

systemctl status resilio-sync

jack Ali

18 change directory

cd #change directory format: cd [option] [directory] cd ./ #current folder cd .. # upper folder cd ~ #home directory pwd #print working directory mkdir #make directory rmdir #remove directory cd - #last directory

19 list files

ls #list files/folder in the current directory

20 copy, delete and remove

cp #copy rm #remove mv #move

21 SSH Shell

22 file format

 

22.1 Bourne Shell Script

extension: .sh

23 Error Log

 

23.1 -bash: ./foo.sh: Permission denied.

I have a script called foo.sh in my home folder.

When I navigate to this folder, and enter ./foo.sh, I get

-bash: ./foo.sh: Permission denied.

When I use sudo ./foo.sh, I get

sudo: foo.sh: command not found.

Why does this happen and how I can fix it?

23.2 When adding shared folder with btsync: “Don't have permissions to write to selected folder”

If your btsync is run by the user named btsync, you should actually add your folder's owner to btsync:

chown -R btsync foldername

Or if you're using resilio you should change folder owner to relsync:

chown -R rslsync foldername

24 FAQ

Author: kemina

Created: 2019-03-19 Tue 22:26

Emacs 24.5.1 (Org mode 8.2.10)

Validate

Ubuntu notes的更多相关文章

  1. 在 Ubuntu 15.04 中使用 ubuntu-make、Eclipse 4.4、Java 8 以及 WTP

    Ubuntu 今天发布新版本了 其实昨天(2015-04-23)我就看到了 Ubuntu 发布新版本的新闻,下班后回家的第一件事就是访问 Ubuntu 的官网,很可惜,没有提供下载.今天(2015-0 ...

  2. 介绍两个Ubuntu上的桌面小工具

    经常使用Windows10,Sticky Notes和壁纸自动切换功能挺好用的.我经常会使用Sticky Notes来记录一些信息,内容是实时保存的,而且启动的时候会自动显示在桌面上.其实Ubuntu ...

  3. 阿里云Ubuntu 14.04 + Nginx + let's encrypt 搭建https访问

    参考页面: https://certbot.eff.org/#ubuntutrusty-nginx http://bbs.qcloud.com/thread-12059-1-1.html http:/ ...

  4. 【转】win8.1下安装ubuntu

    参考:http://jingyan.baidu.com/article/14bd256e0ca52ebb6d26129c.html Ubuntu 系统是一款优秀的.基于GNU/Linux 的平台的桌面 ...

  5. Ubuntu上安装MongoDB(译)

    add by zhj:直接从第四步开始就可以了,而且安装好MongoDB后会自动启动的,不必自己去执行启动命令 原文:https://docs.mongodb.com/manual/tutorial/ ...

  6. 【转载】Ubuntu下SVN安装和配置

    一.SVN安装 1.安装包 1.$ sudo apt-get install subversion 2.创建项目目录 $ sudo mkdir /home/xiaozhe/svn $ cd /home ...

  7. Ubuntu进阶学习,指令迅速查询,Bug迅速查询(Ctrl+F)

    There is some notes while I am learning Ubuntu Operate System! (Ask Ubuntu) 1-- Hard link : ln comma ...

  8. Ubuntu下编译Chromium for Android

    转自:http://blog.csdn.net/fsz521/article/details/18036835 下源码git clone https://chromium.googlesource.c ...

  9. How to join a Ubuntu to Windows Domain

    My testing environment: Windows Server 2012 R2 Essentials: With AD and standalone DC in one single b ...

随机推荐

  1. 手推Apriori算法------挖掘频繁项集

    版权声明:本文为博主原创文章,未经博主允许不得转载. Apriori算法: 使用一种称为逐层搜索的迭代方法,其中K项集用于搜索(K+1)项集. 首先,通过扫描数据库,统计每个项的计数,并收集满足最小支 ...

  2. SpringBoot中使用spring-data-jpa 数据库操作(上)

    Java客户端使用Spring-Data-Jpa这个组件. Spring-Data-Jpa就是Spring对Hibernate的一个整合. 选择create在运行的时候它会自动帮我们创建一个表. sp ...

  3. bzoj 1087: [SCOI2005]互不侵犯King【状压dp】

    显然是状压,设f[i][j][k]为1到i行选j个king,并且第i行状态为k的方案数,判断是否可行然后枚举转移即可 先把可行状态预处理出来会变快 #include<iostream> # ...

  4. akka监控框架设计

    本博客介绍一种AOP.无侵入的akka监控方案,方便大家在生产使用akka的过程中对akka进行监控. 对于自身javaer来说,AOP三个字母基本就解释清楚了akka监控框架的原理.哈哈哈,不过我这 ...

  5. org.apache.poi.hssf.util.Region

    从POI 3.18开始被Deprecated,在3.20版本中被移除了,所以3.20以前的都有 为了避免这个问题,用CellRangeAddress代替Region,其用法相同

  6. (数论)51NOD 1073 约瑟夫环

    N个人坐成一个圆环(编号为1 - N),从第1个人开始报数,数到K的人出列,后面的人重新从1开始报数.问最后剩下的人的编号.例如:N = 3,K = 2.2号先出列,然后是1号,最后剩下的是3号.In ...

  7. QQ自动登录Demo源码(附全套WindowsApi)

    在开发过程中,偶尔会有自动化操作软件的需求,便想到用句柄实现自动化的功能,记录下知识点,以作备忘. 实现流程: 获取窗口句柄,根据定位获取input,调用windowsapi模拟鼠标点击, 输入 , ...

  8. Eclipse/STS 在线安装阿里java代码规约插件

    1.打开Idea的在线安装插件界面,通过“Help”-->“Install New Software...” 进入 2. 在 “Work with” 栏输入插件包的下载地址:https://p3 ...

  9. [GDOI2014]拯救莫莉斯

    题目描述 莫莉斯·乔是圣域里一个叱咤风云的人物,他凭借着自身超强的经济头脑,牢牢控制了圣域的石油市场. 圣域的地图可以看成是一个n*m的矩阵.每个整数坐标点(x , y)表示一座城市吗,两座城市间相邻 ...

  10. 状压DP UVA 11795 Mega Man's Mission

    题目传送门 /* 题意:洛克人有武器可以消灭机器人,还可以从被摧毁的机器人手里得到武器,问消灭全部机器人的顺序总数 状态压缩DP:看到数据只有16,就应该想到状压(并没有).因为是照解题报告写的,代码 ...