Original idea from http://emacsworld.blogspot.com/2011/05/automatic-screenshot-insertion-in-org.html
Original script using imagemagick:
Using scrot :
1
2
3
4
5
6
7
8
9
10
11
12
| (defun org-screenshot ()
"Take a screenshot into a time stamped unique-named file in the same directory as the org-buffer and insert a link to this file."
(interactive)
(setq filename
(concat
(make-temp-name
(concat (buffer-file-name)
"_"
(format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
(call-process "scrot" nil nil nil "-s" filename)
(insert (concat "[[" filename "]]"))
(org-display-inline-images)) |
Script, tips
emacs, linux, org-mode, Script, tips
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# Unmount the filesystem and check its' LV
umount /mnt/foo
e2fsck -f /dev/mapper/vg0-foo
# Shrink ext4 and then the LV to the desired size
resize2fs -p /dev/mapper/vg0-foo 40G
lvreduce -L 40G /dev/mapper/vg0-foo
# Before continuing, run e2fsck. If it bails because the partition
# is too small, don't panic! The LV can still be extended with
# lvextend until e2fsck succeeds, e.g.:
# lvextend -L +1G /dev/mapper/vg0-foo
e2fsck -f /dev/mapper/vg0-foo
# Resize the filesystem to match the LVs size, check and mount it
resize2fs -p /dev/mapper/vg0-foo
e2fsck -f /dev/mapper/vg0-foo
mount /mnt/foo |
1
2
3
4
5
6
7
8
9
10
11
|
umount /mnt/bar
# Extend the LV to use all free space
lvextend -l +100%FREE /dev/mapper/vg0-bar
e2fsck -f /dev/mapper/vg0-bar
# Resize the partition to fill the LV
resize2fs -p /dev/mapper/vg0-bar
e2fsck -f /dev/mapper/vg0-bar
mount /mnt/bar |
source:
source
Script, tips
bash, ext4, linux, lvm, resize, Script, tips
Simple but power command to search text inside file ed order list file by date ….. thx to google and all user
1
| grep -rl 'REGEX' * | xargs ls -trl |
Script
linux, Script, tips
wac.exe is a small command line utility that lets you use ANSI colors on Windows.
link
https://github.com/aslakhellesoy/wac
ruby, Script, tips, Uncategorized
Script, tips
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| #!/bin/bash
# Backup file remote/local
# By Carlo Bertini [WaYdotNET]
# il tutto utilizzando rsync senza scomodare subversion
# RSYNC OPTION
# -r => ricorsivo
# -l => copy symlinks as symlinks
# -p => preserve permissions
# -v => verbose
# -u => update, ignorare i file che sono più nuovi nella destinazione
# -a => archive mode
# -z => comprime i file durante l invio
# -h => rendere leggibile l output
# --delete => cancello i file estranei nella destinazione
# il comando si deve chiamare con:
demo="sync_to_waydotnet [up or down] local_folder remote_folder"
# VARIABILI
base="~/backup"
type=$1
local_folder=$2
remote_folder=$base/$3
host="HOST.EXT"
user="user"
if [ $type = "up" ] ; then
echo "UPLOAD $local ==> $remote"
rsync -lrpuazhv --delete -e ssh $local_folder $user@$host:$remote_folder
elif [ $type = "down" ] ; then
echo "DOWNLOAD ...... $remote ==> $local"
rsync -lrpuazhv --delete -e ssh $user@$host:$remote_folder $local_folder
else
echo -e "la forma corretta da scrivere e' \n $demo'"
fi
echo "Have a nice day :P" |
Script, tips
backup, linux, rsync, Script