to clone SD Card
https://devicetests.com/clone-sd-card-dd-command-ubuntu
sudo fdisk -l
sudo umount /dev/mmcblk0
sudo dd if=/dev/mmcblk0 of=~/sd-card-copy.img bs=1M status=progress
sudo dd if=~/sd-card-copy.img of=/dev/mmcblk0 bs=1M status=progress
ffmpeg -i in.mov -q:v 10 out.mp4
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
netsh wlan show drivers
netsh interface set interface name="Wi-Fi" admin=disabled
netsh wlan set hostednetwork mode=allow ssid=Your_SSID key=Your_Passphrase
netsh wlan start hostednetwork
netsh interface set interface name="Wi-Fi" admin=enabled
to verify all files in a folder
$ cd orig.dir
$ find . -type f -print0 | xargs -0 md5sum > /sums.md5
$ cd copy.dir
$ md5sum -c /sums.md5
$ gpg2 --list-keys
$ gpg2 --delete-key username
to exclude a folder from diff
$ diff -qr --exclude=".svn" ./tools /opt/cada/trunk/tools
to find current folder size
$ du -sh .
to search for a file in DOS
$ dir /B /S LWH420*
to search and replace all in vi
> :%s/mozgroup.com/mozgroup.net/g
to list folders by size
$ du --exclude "mnt" -h --max-depth=1 . | sort -n -r
to find a file by content
$ find . | xargs grep 'toggle_order' -sl
$ find . | xargs grep 'Registering' -sl
or
$ find . -exec grep -l url_host {} \; 2> /dev/null
to find a file by name
$ find . -name *3851*
to list folder by only filename and size
$ ls -l *.jar | awk '{print $9,"\t", $5}' | sort
to search for class in a list of jars
$ find . -name '*.jar' -exec grep -Hls SoftTokenDeviceTypeDTO {} \;
to split large log file
$ split --bytes=1MB /var/www/vhost/data.meters.us/current/log/production.log /home/aleung/log/
in /etc/ssh/sshd_config add:PermitUserEnvironment yes
cd ~/ mkdir .ssh env > .ssh/environment
/etc/init.d/sshd restart
in laptop:
git remote add cadadev01 ssh://silver@host/~/test/project
export GIT_AUTHOR_DATE="2017-07-01T13:13:22+11:11"
export GIT_AUTHOR_DATE="2017-07-02T15:23:12+11:12"
export GIT_COMMITTER_DATE="2017-07-21T12:11:10+11:12"
openssl aes-128-cbc -d -in n20161212 | tar xz
openssl aes-128-cbc -d -in n20161212 | tar tz
tar cz n | openssl aes-128-cbc -out n20161212
tar czf work20161213 work
tar tzf work20161213
tar xzf work20161213
tar czf p.tar p
openssl aes-128-cbc -salt -pbkdf2 -in p.tar -out p20190729
openssl aes-128-cbc -salt -pbkdf2 -d -in p20190729 -out p.tar
tar xzf p.tar
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=90469
To setup Raspberry Pi wifi upon restart
sudo dhclient
https://stackoverflow.com/questions/36926764/cant-access-jenkins-running-on-a-raspberry-pi-using-port-8080
netsh wlan show drivers
netsh interface set interface name="Wi-Fi" admin=disabled
netsh wlan set hostednetwork mode=allow ssid=Your_SSID key=Your_Passphrase
netsh wlan start hostednetwork
netsh interface set interface name="Wi-Fi" admin=enabled
to verify all files in a folder
$ cd orig.dir
$ find . -type f -print0 | xargs -0 md5sum > /sums.md5
$ cd copy.dir
$ md5sum -c /sums.md5
$ gpg2 --list-keys
$ gpg2 --delete-key username
to exclude a folder from diff
$ diff -qr --exclude=".svn" ./tools /opt/cada/trunk/tools
to find current folder size
$ du -sh .
to search for a file in DOS
$ dir /B /S LWH420*
to search and replace all in vi
> :%s/mozgroup.com/mozgroup.net/g
to list folders by size
$ du --exclude "mnt" -h --max-depth=1 . | sort -n -r
to find a file by content
$ find . | xargs grep 'toggle_order' -sl
$ find . | xargs grep 'Registering' -sl
or
$ find . -exec grep -l url_host {} \; 2> /dev/null
to find a file by name
$ find . -name *3851*
to list folder by only filename and size
$ ls -l *.jar | awk '{print $9,"\t", $5}' | sort
to search for class in a list of jars
$ find . -name '*.jar' -exec grep -Hls SoftTokenDeviceTypeDTO {} \;
to split large log file
$ split --bytes=1MB /var/www/vhost/data.meters.us/current/log/production.log /home/aleung/log/
in /etc/ssh/sshd_config add:PermitUserEnvironment yes
cd ~/ mkdir .ssh env > .ssh/environment
/etc/init.d/sshd restart
in laptop:
git remote add cadadev01 ssh://silver@host/~/test/project
export GIT_AUTHOR_DATE="2017-07-01T13:13:22+11:11"
export GIT_AUTHOR_DATE="2017-07-02T15:23:12+11:12"
export GIT_AUTHOR_DATE="2017-07-03T12:21:14+12:14"
export GIT_AUTHOR_DATE="2017-07-04T16:11:24+13:18"
export GIT_COMMITTER_DATE="2017-07-21T12:11:10+11:12"
openssl aes-128-cbc -d -in n20161212 | tar xz
openssl aes-128-cbc -d -in n20161212 | tar tz
tar cz n | openssl aes-128-cbc -out n20161212
tar czf work20161213 work
tar tzf work20161213
tar xzf work20161213
tar czf p.tar p
openssl aes-128-cbc -salt -pbkdf2 -in p.tar -out p20190729
openssl aes-128-cbc -salt -pbkdf2 -d -in p20190729 -out p.tar
tar xzf p.tar
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=90469
To setup Raspberry Pi wifi upon restart
sudo dhclient
https://stackoverflow.com/questions/36926764/cant-access-jenkins-running-on-a-raspberry-pi-using-port-8080
No comments:
Post a Comment