$ crunch <最短字数> <最常字数> <字元集合> –o <输出路径>
$ crunch 3 4 ignite –o /root/dict.txt
$ cewl <URL> -d <深度数> -w <输出路径>
$ cewl www.yahoo.com -d 2 -w /root/dict.txt
广告
本站里的文章大部分经过自行整理与测试
2019年3月3日星期日
2019年3月2日星期六
Linux: 密码破解 john 工具
https://www.openwall.com/john/
安装
$ wget https://www.openwall.com/john/j/john-1.8.0.tar.gz
$ tar zxvf john-1.8.0.tar.gz
$ cd john-1.8.0
$ cd src
$ make
$ make clean SYSTEM
$ make clean generic
$ cd ../run
或
$ sudo apt install john
以 root 权限运行
$ su root
下载字典
$ cd /root
$ wget http://scrapmaker.com/data/wordlists/dictionaries/rockyou.txt
暴力破解密码 (字典上必须要有你的密码, 否则破解不了)
$ john -w:/root/rockyou.txt /etc/shadow
安装
$ wget https://www.openwall.com/john/j/john-1.8.0.tar.gz
$ tar zxvf john-1.8.0.tar.gz
$ cd john-1.8.0
$ cd src
$ make
$ make clean SYSTEM
$ make clean generic
$ cd ../run
或
$ sudo apt install john
以 root 权限运行
$ su root
下载字典
$ cd /root
$ wget http://scrapmaker.com/data/wordlists/dictionaries/rockyou.txt
暴力破解密码 (字典上必须要有你的密码, 否则破解不了)
$ john -w:/root/rockyou.txt /etc/shadow
2019年2月27日星期三
在 wayland 解决 gufw 不能打开..
1) 检查是否用着 wayland
$ echo $XDG_SESSION_TYPE
wayland
其实, 也可以 logout 选择 x11
2) 添加
$ xhost +si:localuser:root
3) 尝试打开 gufw
$ sudo gufw
$ echo $XDG_SESSION_TYPE
wayland
其实, 也可以 logout 选择 x11
2) 添加
$ xhost +si:localuser:root
3) 尝试打开 gufw
$ sudo gufw
2019年2月25日星期一
Boxcryptor Classic 文件夹(*.bc) 转成 Encfs 挂载
https://launchpad.net/~gencfsm/+archive/ubuntu/ppa
1) 安装 Gnome EncFS Manager
$ sudo add-apt-repository ppa:gencfsm/ppa
$ sudo apt-get update
$ sudo apt install gnome-encfs-manager
2) 将 BoxCryptor Classic 文件夹 (*.bc) 转去 EncFS 用
$ cd ~/Boxcryptor-Classic-folder.bc
$ cp Keyfile.bcx .encfs6.xml
3) Gnome Encfs Manager
在 Directory or drive to encrypt or import 添加 *.bc 所在处
(挂载, 需要密码)
2019年2月21日星期四
Ubuntu - OpenSnitch 应用防火墙
https://github.com/evilsocket/opensnitch
OpenSnitch 是从 Little Snitch 上移植过来的。
而 Little Snitch 是专门为 Mac OS 设计的一款应用程序防火墙。
OpenSnitch 是由 Simone Margaritelli 设计,也称为 evilsocket。
OpenSnitch 所做的主要事情就是跟踪你机器上安装的应用程序所发起的互联网请求。
OpenSnitch 允许你去创建规则以同意或阻止那个应用程序发起的互联网访问。
当一个应用程序尝试去访问互联网而没有相应的访问规则存在时,
就会出现一个对话框,这个对话框让你去选择允许还是阻止那个连接。
你也可以决定这个新规则是应用到进程上、
具体的 URL 上、域名上、单个实例上,以及本次会话还是永久有效。
1) Go 安装与配置
$ sudo apt-get install golang-go
$ sudo gedit .bashrc
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
$ source .bashrc
2) opensnitch 安装
$ sudo apt-get install protobuf-compiler libpcap-dev libnetfilter-queue-dev python3-pip
$ go get github.com/golang/protobuf/protoc-gen-go
$ go get -u github.com/golang/dep/cmd/dep
$ python3 -m pip install --user grpcio-tools
$ go get github.com/evilsocket/opensnitch
$ cd $GOPATH/src/github.com/evilsocket/opensnitch
$ make
$ sudo make install
3) 安装 opensnitch 监控文件, 让 systemd 可管理
$ cd $GOPATH/src/github.com/evilsocket/opensnitch/daemon
$ make
$ sudo make install
4) 安装 opensnitch UI
$ sudo apt-get install python-pyqt5
$ cd $GOPATH/src/github.com/evilsocket/opensnitch/ui
$ sudo pip3 install -r requirements.txt
$ sudo pip3 install .
$ cp opensnitch_ui.desktop ~/.config/autostart/
5) 启动
$ sudo systemctl enable opensnitchd
$ sudo service opensnitchd start
$ opensnitch-ui
2019年2月20日星期三
gydl (youtube-dl GUI)
gydl
Python 3 所写,
也是一个以 youtube-dl 为基础的 GUI
https://github.com/JannikHv/gydl
snap
---------
https://snapcraft.io/gydl
$ sudo snap install gydl
flatpak
----------
1) flatpak 安装
https://flatpak.org/setup/Ubuntu/
$ sudo add-apt-repository ppa:alexlarsson/flatpak
$ sudo apt update
$ sudo apt install flatpak
$ sudo apt install gnome-software-plugin-flatpak
$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
其它 linux 版本, 看 https://flatpak.org/setup/
2) 重启
3) 浏览/安装/运行
https://flathub.org/apps/details/com.github.JannikHv.Gydl
$ flatpak install flathub com.github.JannikHv.Gydl
$ flatpak run com.github.JannikHv.Gydl
Python 3 所写,
也是一个以 youtube-dl 为基础的 GUI
https://github.com/JannikHv/gydl
snap
---------
https://snapcraft.io/gydl
$ sudo snap install gydl
flatpak
----------
1) flatpak 安装
https://flatpak.org/setup/Ubuntu/
$ sudo add-apt-repository ppa:alexlarsson/flatpak
$ sudo apt update
$ sudo apt install flatpak
$ sudo apt install gnome-software-plugin-flatpak
$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
其它 linux 版本, 看 https://flatpak.org/setup/
2) 重启
3) 浏览/安装/运行
https://flathub.org/apps/details/com.github.JannikHv.Gydl
$ flatpak install flathub com.github.JannikHv.Gydl
$ flatpak run com.github.JannikHv.Gydl
2019年2月19日星期二
you-get 视频下载器
这是一个 Python 3 编写的命令行下载器,
可以让你从 Youtube、Facebook、Twitter 等很多热门网站下载图片, 音频和视频.
目前该下载器支持 80+ 站点
https://you-get.org/#supported-sites
https://github.com/soimort/you-get
1) 安装
$ pip3 install you-get
$ pip3 install --upgrade you-get
2) 下载视频
$ you-get https://www.youtube.com/watch?v=bBcp_ljCBGU
找 info, 得到 itag
根据 itag, 可以选择下载不同 quality 视频
$ you-get -i https://www.youtube.com/watch?v=bBcp_ljCBGU
$ you-get --itag=397 https://www.youtube.com/watch?v=bBcp_ljCBGU
3) 搜索视频
$ you-get '童话'
可以让你从 Youtube、Facebook、Twitter 等很多热门网站下载图片, 音频和视频.
目前该下载器支持 80+ 站点
https://you-get.org/#supported-sites
https://github.com/soimort/you-get
1) 安装
$ pip3 install you-get
$ pip3 install --upgrade you-get
2) 下载视频
$ you-get https://www.youtube.com/watch?v=bBcp_ljCBGU
找 info, 得到 itag
根据 itag, 可以选择下载不同 quality 视频
$ you-get -i https://www.youtube.com/watch?v=bBcp_ljCBGU
$ you-get --itag=397 https://www.youtube.com/watch?v=bBcp_ljCBGU
3) 搜索视频
$ you-get '童话'
Linux 中 Wondershaper 限制网络带宽
1) 安装
$ git clone https://github.com/magnific0/wondershaper.git
$ cd wondershaper
$ sudo make install
2) 自启
$ sudo systemctl enable wondershaper.service
$ sudo systemctl start wondershaper.service
3) 查询到网卡的详细信息
$ ip addr
$ route
$ ifconfig
4) 限制网络带宽
$ sudo wondershaper -a <adapter> -d <rate> -u <rate>
$ sudo wondershaper -a enp0s8 -d 1024 -u 512
-a:网卡名称
-d:下行带宽(Kbps)
-u:上行带宽(Kbps)
5) 网卡解除网络带宽的限制
$ sudo wondershaper -c -a enp0s8
或
$ sudo wondershaper -c enp0s8
6) 配置文件
$ sudo gedit /etc/conf.d/wondershaper.conf
[wondershaper]
# Adapter
#
IFACE="eth0"
# Download rate in Kbps
#
DSPEED="2048"
# Upload rate in Kbps
#
USPEED="512"
$ git clone https://github.com/magnific0/wondershaper.git
$ cd wondershaper
$ sudo make install
2) 自启
$ sudo systemctl enable wondershaper.service
$ sudo systemctl start wondershaper.service
3) 查询到网卡的详细信息
$ ip addr
$ route
$ ifconfig
4) 限制网络带宽
$ sudo wondershaper -a <adapter> -d <rate> -u <rate>
$ sudo wondershaper -a enp0s8 -d 1024 -u 512
-a:网卡名称
-d:下行带宽(Kbps)
-u:上行带宽(Kbps)
5) 网卡解除网络带宽的限制
$ sudo wondershaper -c -a enp0s8
或
$ sudo wondershaper -c enp0s8
6) 配置文件
$ sudo gedit /etc/conf.d/wondershaper.conf
[wondershaper]
# Adapter
#
IFACE="eth0"
# Download rate in Kbps
#
DSPEED="2048"
# Upload rate in Kbps
#
USPEED="512"
2019年2月18日星期一
Ubuntu - OneDrive (rclone 挂载)
1) rclone 安装
https://rclone.org/downloads/
$ wget https://downloads.rclone.org/v1.46/rclone-v1.46-linux-amd64.deb
$ sudo apt install libfuse2 rclone-browser
$ sudo dpkg -i rclone-v1.46-linux-amd64.deb
2) 让软件得到权限处理 OneDrive 文件 (取得 access_token)
$ rclone authorize "onedrive"
$ rclone authorize "box"
$ rclone authorize "yandex"
$ rclone authorize "dropbox"
# google drive 不需要, 直接可跑 rclone config
2019/02/18 02:15:53 NOTICE: Config file "/home/username/.config/rclone/rclone.conf" not found - using defaults
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
Paste the following into your remote machine --->
{"access_token":"","expiry":"2019-02-18T03:16:12.502116809+08:00"}
<---End paste
3) rclone 配置 (new remote_name: bat)(OneDrive)
$ rclone config
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> bat (之后可以改名)
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / A stackable unification remote, which can appear to merge the contents of several remotes
\ "union"
2 / Alias for a existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Dropbox
\ "dropbox"
9 / Encrypt/Decrypt a remote
\ "crypt"
10 / FTP Connection
\ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
12 / Google Drive
\ "drive"
13 / Hubic
\ "hubic"
14 / JottaCloud
\ "jottacloud"
15 / Local Disk
\ "local"
16 / Mega
\ "mega"
17 / Microsoft Azure Blob Storage
\ "azureblob"
18 / Microsoft OneDrive
\ "onedrive"
19 / OpenDrive
\ "opendrive"
20 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
21 / Pcloud
\ "pcloud"
22 / QingCloud Object Storage
\ "qingstor"
23 / SSH/SFTP Connection
\ "sftp"
24 / Webdav
\ "webdav"
25 / Yandex Disk
\ "yandex"
26 / http Connection
\ "http"
Storage> 18
** See help for onedrive backend at: https://rclone.org/onedrive/ **
Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> 空
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> 空
Edit advanced config? (y/n)
y) Yes
n) No
y/n> y
Chunk size to upload files with - must be multiple of 320k.
Above this size files will be chunked - must be multiple of 320k. Note
that the chunks will be buffered into memory.
Enter a size with suffix k,M,G,T. Press Enter for the default ("10M").
chunk_size> 空
The ID of the drive to use
Enter a string value. Press Enter for the default ("").
drive_id> 空
The type of the drive ( personal | business | documentLibrary )
Enter a string value. Press Enter for the default ("").
drive_type> 空
Set to make OneNote files show up in directory listings.
By default rclone will hide OneNote files in directory listings because
operations like "Open" and "Update" won't work on them. But this
behaviour may also prevent you from deleting them. If you want to
delete OneNote files or otherwise want them to show up in directory
listing, set this option.
Enter a boolean value (true or false). Press Enter for the default ("false").
expose_onenote_files>
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> n (如果是 Google Drive, 选 y)
For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine:
rclone authorize "onedrive"
Then paste the result below:
result> {"access_token":"","expiry":"2019-02-18T03:16:12.502116809+08:00"}
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Type in driveID
\ "driveid"
4 / Type in SiteID
\ "siteid"
5 / Search a Sharepoint site
\ "search"
Your choice> 1
Found 1 drives, please select the one you want to use:
0: (personal) id=abc123567890
Chose drive to use:> 0
Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=abc123567890
Is that okay?
y) Yes
n) No
y/n> y
--------------------
[bat]
type = onedrive
token = {"access_token":"","expiry":"2019-02-18T03:16:12.502116809+08:00"}
drive_id = abc123567890
drive_type = personal
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name Type
==== ====
bat onedrive
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
4) fuse 配置 (拿掉以下前面的 # 符号)
$ sudo gedit /etc/fuse.conf
user_allow_other
5) 挂载
$ mkdir -p /home/username/My_OneDrive
$ rclone mount bat:/ /home/username/My_OneDrive
--copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
6) 卸载
$ fusermount -qzu /home/username/My_OneDrive
7) 自启 Startup Applications
将步骤5挂载命令加入到 Startup Application 即可
https://rclone.org/downloads/
$ wget https://downloads.rclone.org/v1.46/rclone-v1.46-linux-amd64.deb
$ sudo apt install libfuse2 rclone-browser
$ sudo dpkg -i rclone-v1.46-linux-amd64.deb
2) 让软件得到权限处理 OneDrive 文件 (取得 access_token)
$ rclone authorize "onedrive"
$ rclone authorize "box"
$ rclone authorize "yandex"
$ rclone authorize "dropbox"
# google drive 不需要, 直接可跑 rclone config
2019/02/18 02:15:53 NOTICE: Config file "/home/username/.config/rclone/rclone.conf" not found - using defaults
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
Paste the following into your remote machine --->
{"access_token":"","expiry":"2019-02-18T03:16:12.502116809+08:00"}
<---End paste
3) rclone 配置 (new remote_name: bat)(OneDrive)
$ rclone config
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> bat (之后可以改名)
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / A stackable unification remote, which can appear to merge the contents of several remotes
\ "union"
2 / Alias for a existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Dropbox
\ "dropbox"
9 / Encrypt/Decrypt a remote
\ "crypt"
10 / FTP Connection
\ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
12 / Google Drive
\ "drive"
13 / Hubic
\ "hubic"
14 / JottaCloud
\ "jottacloud"
15 / Local Disk
\ "local"
16 / Mega
\ "mega"
17 / Microsoft Azure Blob Storage
\ "azureblob"
18 / Microsoft OneDrive
\ "onedrive"
19 / OpenDrive
\ "opendrive"
20 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
21 / Pcloud
\ "pcloud"
22 / QingCloud Object Storage
\ "qingstor"
23 / SSH/SFTP Connection
\ "sftp"
24 / Webdav
\ "webdav"
25 / Yandex Disk
\ "yandex"
26 / http Connection
\ "http"
Storage> 18
** See help for onedrive backend at: https://rclone.org/onedrive/ **
Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> 空
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> 空
Edit advanced config? (y/n)
y) Yes
n) No
y/n> y
Chunk size to upload files with - must be multiple of 320k.
Above this size files will be chunked - must be multiple of 320k. Note
that the chunks will be buffered into memory.
Enter a size with suffix k,M,G,T. Press Enter for the default ("10M").
chunk_size> 空
The ID of the drive to use
Enter a string value. Press Enter for the default ("").
drive_id> 空
The type of the drive ( personal | business | documentLibrary )
Enter a string value. Press Enter for the default ("").
drive_type> 空
Set to make OneNote files show up in directory listings.
By default rclone will hide OneNote files in directory listings because
operations like "Open" and "Update" won't work on them. But this
behaviour may also prevent you from deleting them. If you want to
delete OneNote files or otherwise want them to show up in directory
listing, set this option.
Enter a boolean value (true or false). Press Enter for the default ("false").
expose_onenote_files>
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> n (如果是 Google Drive, 选 y)
For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine:
rclone authorize "onedrive"
Then paste the result below:
result> {"access_token":"","expiry":"2019-02-18T03:16:12.502116809+08:00"}
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Type in driveID
\ "driveid"
4 / Type in SiteID
\ "siteid"
5 / Search a Sharepoint site
\ "search"
Your choice> 1
Found 1 drives, please select the one you want to use:
0: (personal) id=abc123567890
Chose drive to use:> 0
Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=abc123567890
Is that okay?
y) Yes
n) No
y/n> y
--------------------
[bat]
type = onedrive
token = {"access_token":"","expiry":"2019-02-18T03:16:12.502116809+08:00"}
drive_id = abc123567890
drive_type = personal
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name Type
==== ====
bat onedrive
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
4) fuse 配置 (拿掉以下前面的 # 符号)
$ sudo gedit /etc/fuse.conf
user_allow_other
5) 挂载
$ mkdir -p /home/username/My_OneDrive
$ rclone mount bat:/ /home/username/My_OneDrive
--copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
6) 卸载
$ fusermount -qzu /home/username/My_OneDrive
7) 自启 Startup Applications
将步骤5挂载命令加入到 Startup Application 即可
2019年2月17日星期日
OpenDrive (Google Drive 客户端)
OpenDrive (非官方软件)
https://electronjs.org/apps/odrive
https://github.com/liberodark/ODrive
https://snapcraft.io/odrive-unofficial
也是 Google Drive 客户端软件,
只不过它是 Electron App.
支持 Linux / Mac / Windows.
snap 安装
------------
$ sudo snap install odrive-unofficial
deb 安装
------------
$ wget https://github.com/liberodark/ODrive/releases/download/0.2.0/odrive_0.2.0_amd64.deb
$ sudo dpkg -i odrive_0.2.0_amd64.deb
$ sudo apt --fix-broken install
https://electronjs.org/apps/odrive
https://github.com/liberodark/ODrive
https://snapcraft.io/odrive-unofficial
也是 Google Drive 客户端软件,
只不过它是 Electron App.
支持 Linux / Mac / Windows.
snap 安装
------------
$ sudo snap install odrive-unofficial
deb 安装
------------
$ wget https://github.com/liberodark/ODrive/releases/download/0.2.0/odrive_0.2.0_amd64.deb
$ sudo dpkg -i odrive_0.2.0_amd64.deb
$ sudo apt --fix-broken install
Ubuntu 挂载 Google Drive (google-drive-ocamlfuse)
----------------------------------------------------------
google-drive-ocamlfuse
https://github.com/astrada/google-drive-ocamlfuse
https://launchpad.net/~alessandro-strada/+archive/ubuntu/ppa
----------------------------------------------------------
1) 安装 google-drive-ocamlfuse
$ sudo add-apt-repository ppa:alessandro-strada/ppa
$ sudo apt-get update
$ sudo apt-get install google-drive-ocamlfuse
2) 先创建一个名叫 Google_Drive 的文件夹(挂载点)
$ mkdir ~/Google_Drive
3) 利用软件 google-drive-ocamlfuse 创建一个标签,
而这个标签会连接到以上文件夹
$ google-drive-ocamlfuse -label My_Google_Drive ~/Google_Drive
第一次, 会打开浏览器进入 Google 户口里,
要给这软件权限处理 Google Drive 中的文件.
完成后, 会出现 Access token retrieved correctly.
之后,
Files 文件浏览器的左边框会出现 My_Google_Drive,
点击进去(等于挂载)就可以进入自己户口的 Google Drive.
挂载后, ~/Google_Drive 就会有文件列表了.
(除非主动去处理文件, 否则不会自动下载文件)
4) 可以在 Startup Applications 加入
Name: Google_Drive
Command: /usr/bin/google-drive-ocamlfuse -label My_Google_Drive /home/username/Google_Drive
Comment: 进入 GNOME 后, 自动挂载 Google Drive
* 记得改以上 /home/username 为正确路径
5) 卸载 (Unmount)
$ fusermount -u ~/Google_Drive
google-drive-ocamlfuse
https://github.com/astrada/google-drive-ocamlfuse
https://launchpad.net/~alessandro-strada/+archive/ubuntu/ppa
----------------------------------------------------------
1) 安装 google-drive-ocamlfuse
$ sudo add-apt-repository ppa:alessandro-strada/ppa
$ sudo apt-get update
$ sudo apt-get install google-drive-ocamlfuse
2) 先创建一个名叫 Google_Drive 的文件夹(挂载点)
$ mkdir ~/Google_Drive
3) 利用软件 google-drive-ocamlfuse 创建一个标签,
而这个标签会连接到以上文件夹
$ google-drive-ocamlfuse -label My_Google_Drive ~/Google_Drive
第一次, 会打开浏览器进入 Google 户口里,
要给这软件权限处理 Google Drive 中的文件.
完成后, 会出现 Access token retrieved correctly.
之后,
Files 文件浏览器的左边框会出现 My_Google_Drive,
点击进去(等于挂载)就可以进入自己户口的 Google Drive.
挂载后, ~/Google_Drive 就会有文件列表了.
(除非主动去处理文件, 否则不会自动下载文件)
4) 可以在 Startup Applications 加入
Name: Google_Drive
Command: /usr/bin/google-drive-ocamlfuse -label My_Google_Drive /home/username/Google_Drive
Comment: 进入 GNOME 后, 自动挂载 Google Drive
* 记得改以上 /home/username 为正确路径
5) 卸载 (Unmount)
$ fusermount -u ~/Google_Drive
Linux - OneDrive 客户端
1) 需要3个软件
Ubuntu
$ sudo apt install libcurl4-openssl-dev
$ sudo apt install libsqlite3-dev
https://dlang.org/download.html#dmd
$ wget http://downloads.dlang.org/releases/2.x/2.084.1/dmd_2.084.1-0_amd64.deb
$ sudo dpkg -i dmd_2.084.1-0_amd64.deb
Fedora
sudo dnf install libcurl-devel
sudo dnf install sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd
Arch Linux
sudo pacman -S curl sqlite dlang
2) 编译与安装
$ git clone https://github.com/skilion/onedrive.git
$ cd onedrive
$ make
$ sudo make install
3) 登入
$ onedrive
Authorize this app visiting: 这里会有个权限请求登入网址
打开浏览器, 进入以上网址之后,
在浏览器 copy & paste 以下网址去 Terminal
Enter the response uri: https://login.microsoftonline.com/common/oauth2/nativeclient?code=???
之后, 会开始下载与同步文件到 ~/OneDrive
4) 自启配置
$ systemctl --user enable onedrive
$ systemctl --user start onedrive
Ubuntu
$ sudo apt install libcurl4-openssl-dev
$ sudo apt install libsqlite3-dev
https://dlang.org/download.html#dmd
$ wget http://downloads.dlang.org/releases/2.x/2.084.1/dmd_2.084.1-0_amd64.deb
$ sudo dpkg -i dmd_2.084.1-0_amd64.deb
Fedora
sudo dnf install libcurl-devel
sudo dnf install sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd
Arch Linux
sudo pacman -S curl sqlite dlang
2) 编译与安装
$ git clone https://github.com/skilion/onedrive.git
$ cd onedrive
$ make
$ sudo make install
3) 登入
$ onedrive
Authorize this app visiting: 这里会有个权限请求登入网址
打开浏览器, 进入以上网址之后,
在浏览器 copy & paste 以下网址去 Terminal
Enter the response uri: https://login.microsoftonline.com/common/oauth2/nativeclient?code=???
之后, 会开始下载与同步文件到 ~/OneDrive
4) 自启配置
$ systemctl --user enable onedrive
$ systemctl --user start onedrive
dbxfs: Linux 挂载 Dropbox
https://github.com/rianhunter/dbxfs
1) 安装依赖软件包
Ubuntu
$ sudo apt install libfuse2
Fedora
$ sudo dnf install fuse
2) 安装 dbxfs
$ pip3 install dbxfs
3) 准备挂载点
$ mkdir ~/my_DropBox
4) 让 dbxfs 从 Dropbox 得到处理文件的权限
$ dbxfs ~/my_DropBox
用浏览器进入以下网址, 会得到一个 code,
将它 copy & paste 回 Terminal.
We need an access token. Perform the following steps:
1. Go to https://www.dropbox.com/oauth2/authorize?response_type=code&client_id=abc
2. Click "Allow" (you may have to log in first)
3. Copy the authorization code.
Enter authorization code (Ctrl-C to quit): ABCDEFGHIJKLMNOPQRSTUVWXYZ
We're all connected. Do you want to save your credentials for future runs? [Y/n] y
Would you like to help us improve dbxfs by providing anonymous error reports? [Y/n] y
Do you want "/home/yomun/DropBox" to be the default mount point? [Y/n] y
5) 在 Startup Applications 加入
Name: Dropbox (dbxfs)
Command: dbxfs /home/username/my_DropBox
Comment: 进入 GNOME, 自动启动
1) 安装依赖软件包
Ubuntu
$ sudo apt install libfuse2
Fedora
$ sudo dnf install fuse
2) 安装 dbxfs
$ pip3 install dbxfs
3) 准备挂载点
$ mkdir ~/my_DropBox
4) 让 dbxfs 从 Dropbox 得到处理文件的权限
$ dbxfs ~/my_DropBox
用浏览器进入以下网址, 会得到一个 code,
将它 copy & paste 回 Terminal.
We need an access token. Perform the following steps:
1. Go to https://www.dropbox.com/oauth2/authorize?response_type=code&client_id=abc
2. Click "Allow" (you may have to log in first)
3. Copy the authorization code.
Enter authorization code (Ctrl-C to quit): ABCDEFGHIJKLMNOPQRSTUVWXYZ
We're all connected. Do you want to save your credentials for future runs? [Y/n] y
Would you like to help us improve dbxfs by providing anonymous error reports? [Y/n] y
Do you want "/home/yomun/DropBox" to be the default mount point? [Y/n] y
5) 在 Startup Applications 加入
Name: Dropbox (dbxfs)
Command: dbxfs /home/username/my_DropBox
Comment: 进入 GNOME, 自动启动
Linux - Sublime Text 3 - 安装 + 中文输入
Sublime Text 官网
不知为啥不能进入了,
不过 Linux Mint 软件库存有 sublime-text_3176_amd64.deb 可以下载
http://ftp.riken.jp/Linux/linuxmint/packages/pool/import/s/sublime-text/sublime-text_3176_amd64.deb
http://free.nchc.org.tw/linuxmint/packages/pool/import/s/sublime-text/sublime-text_3176_amd64.deb
http://ucmirror.canterbury.ac.nz/linux/mint/packages/pool/import/s/sublime-text/sublime-text_3176_amd64.deb
更多下载处, 可以 google search "sublime-text_3176_amd64.deb"
这 Sublime Text 版本(3176) 在显示中文方面已没问题了,
但在中文输入..
以下是解决方法:
0) 下载, 然后安装 Sublime Text 3
$ sudo dpkg -i sublime-text_3176_amd64.deb
1) 下载 libsublime-imfix.so, 放到 /opt/sublime_text (Sublime Text 安装处)
$ wget https://github.com/lyfeyaj/sublime-text-imfix/raw/master/lib/libsublime-imfix.so
$ sudo cp libsublime-imfix.so /opt/sublime_text/
2) 修改 subl 命令
$ sudo gedit /usr/bin/subl
#!/bin/sh
export LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so
exec /opt/sublime_text/sublime_text "$@"
$ sudo chmod a+x /usr/bin/subl
3) 修改 sublime_text.desktop (修改执行命令行)
$ sudo gedit /usr/share/applications/sublime_text.desktop
Exec=/opt/sublime_text/sublime_text %F
改为
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so /opt/sublime_text/sublime_text"
不知为啥不能进入了,
不过 Linux Mint 软件库存有 sublime-text_3176_amd64.deb 可以下载
http://ftp.riken.jp/Linux/linuxmint/packages/pool/import/s/sublime-text/sublime-text_3176_amd64.deb
http://free.nchc.org.tw/linuxmint/packages/pool/import/s/sublime-text/sublime-text_3176_amd64.deb
http://ucmirror.canterbury.ac.nz/linux/mint/packages/pool/import/s/sublime-text/sublime-text_3176_amd64.deb
更多下载处, 可以 google search "sublime-text_3176_amd64.deb"
这 Sublime Text 版本(3176) 在显示中文方面已没问题了,
但在中文输入..
以下是解决方法:
0) 下载, 然后安装 Sublime Text 3
$ sudo dpkg -i sublime-text_3176_amd64.deb
1) 下载 libsublime-imfix.so, 放到 /opt/sublime_text (Sublime Text 安装处)
$ wget https://github.com/lyfeyaj/sublime-text-imfix/raw/master/lib/libsublime-imfix.so
$ sudo cp libsublime-imfix.so /opt/sublime_text/
2) 修改 subl 命令
$ sudo gedit /usr/bin/subl
#!/bin/sh
export LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so
exec /opt/sublime_text/sublime_text "$@"
$ sudo chmod a+x /usr/bin/subl
3) 修改 sublime_text.desktop (修改执行命令行)
$ sudo gedit /usr/share/applications/sublime_text.desktop
Exec=/opt/sublime_text/sublime_text %F
改为
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so /opt/sublime_text/sublime_text"
2018年2月22日星期四
Linux - Tomb 文件加密
- Tomb 像个加密文件夹, 你只需要将要加密的文件写在里面即可
- 使用与 Veracrypt 类似的 AES-256 加密标准.这个标准适用于 NSA 、微软和 Apple,并被认为是最安全的加密算法之一
- 专门为 GNU/Linux 系统开发的
- Tomb 是开源的, 但它使用的是静态链接库, 以至于其源代码难以审计
- gtomb 是它的 GUI
安装
$ sudo vi /etc/apt/sources.list.d/sparky-repo.list
deb https://sparkylinux.org/repo stable main
deb-src https://sparkylinux.org/repo stable main
deb https://sparkylinux.org/repo testing main
deb-src https://sparkylinux.org/repo testing main
$ sudo apt-get update
sudo apt-get install sparky-keyring
# wget -O - https://sparkylinux.org/repo/sparkylinux.gpg.key | sudo apt-key add -
$ sudo apt-get install gtomb tomb
或
$ sudo dnf/yum/apt-get install zsh gnupg cryptsetup pinentry-curses
$ wget https://github.com/dyne/Tomb/archive/v2.5.tar.gz
$ tar zxvf v2.5.tar.gz
$ cd Tomb-2.5
$ sudo make install
基本应用
1) 制作 100MB 的 Tomb 文件
$ tomb dig -s 100 Tomb1.tomb
2) 先暂时的关掉 SWAP 分区
$ sudo swapoff -a
或
# 永久的将 swap 分区 remarks 掉 (用 # 符号)
$ sudo gedit /etc/fstab
3) 制作 key, 需要配置密码 (2次)
$ tomb forge Tomb1.tomb.key
4) 用 key 锁上 Tomb, 需要密码
$ tomb lock Tomb1.tomb -k Tomb1.tomb.key
5) 用 key 打开 Tomb, 需要密码
$ tomb open Tomb1.tomb -k Tomb1.tomb.key
6) 关闭 Tomb, 需要密码
$ tomb close
7) 强制关闭所有打开的 Tomb
$ tomb slam all
2018年2月16日星期五
Ubuntu 上用 OpenVPN Access Server
1.1) 主机的静态 Private_IP 192.168.X.X
192.168.X.X 可用 ifconfig 检查
如果没有, 可自己配置
http://jasonmun.blogspot.my/2017/01/linux-network-settings-ip.html
或也可检查 router modem, 在里面 LAN Setup 配置 DHCP
1.2) 开 port 和 Port Forward
router modem 要做 port forward 到以上 Private_IP
1194 (预设用 UDP 协议) 和 943 (预设用 TCP 协议)
如果有安装 firewall, 也需要将这 2 个 Port 打开
2) 下载与安装 OpenVPN Access Server
https://openvpn.net/index.php/access-server/download-openvpn-as-sw.html
$ su
Ubuntu
$ dpkg -i openvpn-as-2.5-Ubuntu16.amd_64.deb
CentOS 7
$ rpm -ivh openvpn-as-2.1.12-CentOS7.x86_64.rpm
3) OpenVPN Access Server 配置
3.1) 配置 openvpn 户口密码
$ passwd openvpn
进 https://192.168.X.X:943/admin
3.2) 网络配置
Configuration - Network Settings - Hostname or IP Address
从 192.168.X.X Private_IP 改为 Public_IP,
如果没有固定的 Public_IP,
但有 Hostname (jasonmun.dlinkddns.com), 放 Hostname 更好,
以后不会因 IP 的改变, 而需要改配置
(UDP Port number 1194 也可以改)
3.3) 配置自动登入
User Management - User Permissions
- openvpn 户口 - 选 allow Auto-login - Save Settings
3.4) 重启服务
Status - Status Overview
- Stop the Server - Confirm Servers Stop - Start the Server
4) 从 OpenVPN Access Server 取得 autologin profile (client.ovpn)
进 https://192.168.X.X:943/
或 https://Public_IP:943/
或 https://Hostname:943/
用 openvpn 户口登入
点选 Yourself (autologin profile) , 得到 client.ovpn
5) 无论在什么平台上安装 OpenVPN 客户端,
只要 import 上 client.ovpn 即可连接
(Free license 能够同时连接 2 个设备)
https://play.google.com/store/apps/details?id=net.openvpn.openvpn
https://play.google.com/store/apps/details?id=de.blinkt.openvpn
https://itunes.apple.com/us/app/openvpn-connect/id590379981?mt=8
2017年12月27日星期三
OnionShare 匿名共享文件
1) 首先下载 OnionShare 和 Tor浏览器。下载后安装它们
https://onionshare.org/
https://www.torproject.org/projects/torbrowser.html.en
2) 从开始菜单打开 OnionShare, Add 一个文件, Start Sharing
它会产生一个 .onion 网址如
http://abc123def.onion/replace-basic
用 TOR 浏览器打开这个网址, 即可点选下载
其他网站或程序可以访问你的文件:
发件人使用 OnionShare 共享的文件不存储在任何服务器上
它直接托管在发件人的系统上
没有人可以窥探共享文件:
由于用户之间的连接是由洋葱服务和 Tor 浏览器加密的。
这使得连接安全,很难窃取文件
用户双方都是匿名的:
OnionShare 和 Tor 浏览器使发件人和收件人匿名
订阅:
博文 (Atom)



