2021年6月21日月曜日

2021年6月19日土曜日

2021年5月10日月曜日

[Rust] Install in advance

$ sudo apt-get install build-essential
$ sudo apt-get install libsqlite3-dev
$ sudo apt-get install libssl-dev
$ sudo apt-get install pig-config
 

[NeoVim] Install for Rust

form https://sts10.github.io/2020/10/11/rust-neovim-setup.html

$ sudo apt install neovim
$ sudo apt install python-neovim
$ sudo apt install python3-neovim
$ rustup component add clippy $ rustup component add rustfmt $ rustup component add rust-src
$ git clone https://github.com/rust-analyzer/rust-analyzer.git && cd rust-analyzer
$
cargo xtask install --server
$ cd .. $ rm -rf rust-analyzer
$ sudo apt-get install python3-pip && pip3 install pynvim neovim

In ~/.config/nvim/init.vim

~~~~~~
call plug#begin('~/.config/nvim/plugged') " ... other plugins here " autocomplete if has('nvim') Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } else Plug 'Shougo/deoplete.nvim' Plug 'roxma/nvim-yarp' Plug 'roxma/vim-hug-neovim-rpc' endif " Language Server Client Plug 'autozimu/LanguageClient-neovim', { \ 'branch': 'next', \ 'do': 'bash install.sh', \ } let g:LanguageClient_serverCommands = { \ 'rust': ['rust-analyzer'], \ } " For improved UI Plug 'junegunn/fzf' Plug 'rust-lang/rust.vim', { 'for': 'rust' } call plug#end() " ... " Configure deoplete let g:deoplete#enable_at_startup = 1 " note that if you are using Plug mapping you should not use `noremap` mappings. nmap <F5> <Plug>(lcn-menu) " Or map each action separately " nmap <silent> <F2> <Plug>(lcn-rename) autocmd FileType rust nmap <silent> gr <Plug>(lcn-rename) " nmap <silent>K <Plug>(lcn-hover) " nmap <silent> gd <Plug>(lcn-definition) " Configure Rust formatter https://github.com/rust-lang/rust.vim#formatting-with-rustfmt " autocmd Filetype rust nnoremap == :RustFmt<CR> let g:rustfmt_autosave = 1





 
 

2018年7月15日日曜日

IPv6 Status

from APNIC


I made the server IPv6.

I made the server IPv6.
①Confirm that IPv6 is invalidated.
$ cat /etc/sysctl.conf
# Do not use IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_
ipv6 = 1
②Activate IPv6.
$ sudo sed -i -e "/net.ipv6.conf.default.disable_ipv6/s/^/#/" /etc/sysctl.conf
$ sudo sed -i -e "/net.ipv6.conf.all.disable_ipv6/s/^/#/" /etc/sysctl.conf
③Enable IPv6 on the interface
$ sudo sed -i -e "s/^#//g" /etc/network/interfaces
④Check the config file.
$ cat /etc/network/interfaces
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto ens3
iface ens3 inet static
address XXX.XXX.XXX.XXX
netmask 255.255.254.0
gateway XXX.XXX.XXX.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX210.188.224.10
dns-search XXX.XXX.XXX.XXX

iface ens3 inet6 static
address 2001:e42:102:1501:XXX:XXX:XXX:XXX
netmask 64
gateway fe80::1
dns-nameservers 2001:e42::2


2018年7月9日月曜日

Update from Rails 5.1.6 to Rails 5.2.0

① Changed description in Gemfile to rails 5.2.0

② bundle update

③ rails app:update

④ Since rails 5.2.0 requires gem called bootsnap, it is added to Gemfile
 gem 'bootsnap'

⑤ bundle install


$ pwd
/var/www/rails/rails5/config/initializers
$ vim callback_terminator.rb
#ActiveSupport.halt_callback_chains_on_return_false = false

⑥ rails s

2018年3月12日月曜日

Install of theHarvester on Ubuntu16.04

▪️Install
$sudo pip2 install request
$git clone https://github.com/laramies/theHarvester.git

▪️test
$ python2 theHarvester.py -d ****.com -l 500 -b all

Install of Volatility in Ubuntu16.04

▪️Required package
$ sudo apt-get install python python-pip unzip subversion pcregrep libpcre++-dev python-dev

▪️Install of PyCrypto
$ sudo pip install pycrypto
$ sudo pip install distorm3

▪️Install of YARA 3.70
$ get https://github.com/VirusTotal/yara/archive/v3.7.0.zip
$ unzip v3.7.0.zip
$ cd yara-3.7.0
$ ./bootstrap.sh
$ sudo apt-get install automake libtool make gcc
$ sudo apt-get install flex bison
$ ./configure
$ make
$ sudo make install

▪️Install of Volantility

$ git clone https://github.com/volatilityfoundation/volatility.git
$ cd volantility
$ sudo python setup.py install

2017年8月21日月曜日

PyTorch

Speaking of Deep Learning's library Tensorflow is famous. Since it was released a year and a half ago, I got a name recognition for a moment.
I began looking for other libraries, thinking that it would be better to use a more flexible library than Keras. Then what is Torch's Python version out there!
DeepMind has moved from Torch to Tensorflow, but I anticipate that you are already using PyTorch. Facebook is also one of the representative companies using Torch, and I am involved in the development of PyTorch.

2017年8月16日水曜日

Imaging mnist data


——mnist_data_image.py------
1 # -*- coding: utf-8 -*-
2
3 import sys
4 import numpy as np
5 np.random.seed(20160715)
6
7 from keras.datasets import mnist
8 from keras.utils import np_utils
9
10 (X_train, y_train), (X_test, y_test) = mnist.load_data()
11
12 for xs in X_train[1]:
13 for x in xs:
14 sys.stdout.write('%03d ' % x)
15 sys.stdout.write('\n')
16
17 print('first sample is %d' % y_train[0])
18
19 Y_train = np_utils.to_categorical(y_train, 10)
20
21 sys.stdout.write('[')
22 for y in Y_train[0]:
23 sys.stdout.write('%f ' % y)
24 sys.stdout.write(']\n')

2017年8月9日水曜日

PWA (progressive web application) supported on iOS

As I wrote in an article I posted in the past, PWA (Progressive Web Application) that I could only use in Chrome until now can be used in Safari.

The advantages of PWA are described below.

1. It is possible to provide user experience that is the same as or close to the application on mobile sites

2. Page loading is fast

3. Push notification is possible

4. By using the service worker mechanism, pages can be used even offline. FINANCIAL TIMES is an example.

OpenCV 3.1.0 install

$ sudo apt-get install build-essential cmake git
$ sudo apt-get install ffmpeg libopencv-dev libgtk-3-dev python-numpy python3-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libv4l-dev libtbb-dev qtbase5-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip

$ wget https://github.com/Itseez/opencv/archive/3.1.0.zip
$ cd opencv-3.1.0
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
$ make
$ sudo make install
$ sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
$ sudo ldconfig

$ sudo pip3 install opencv-python

2017年8月7日月曜日

Machine learning self-made machine starting with low budget

◼️Hardware
GPU: 1050Ti ( CUDA core:678 , Memory : 4GB, Compute Capability : 6.1 )
PCI Express 3.0

◼️Software
(1) Ubuntu 16.04 install
(2) GPU Check
$ lspci | grep NVIDIA
(3) CUDA install
https://developer.nvidia.com/cuda-downloads
$ nvidia-smi
(4) cuDNN Install
https://developer.nvidia.com/rdp/cudnn-download
cuDNN v5.1 Runtime Lirary for Ubuntu 14.04(Deb)
(5) TensorFlow Install
$ pip install tensorflow-gpu
$ pip install keras
$ pip install h5py

fd-find

 $ sudo apt install fd-find $ fdfind 石