sobota, 28 listopada 2015
how to find file with permission 775 and change them to 777 for example
find . -perm 775 -exec chmod 777 {} \;
Enable Trim ubuntu
gksudo gedit /etc/cron.daily/trimand enter the following:
#!/bin/sh
LOG=/var/log/trim.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v / >> $LOG
fstrim -v /home >> $LOG
sudo chmod +x /etc/cron.daily/trim
how to kill all app process
└──╼ pidof chrome
4027 4012 3998 3984 3924 3283 3251 3199 3117 3078 2772 2757 2752 2737 2733 2699 2660 2654 2582 2568 2556
for i in `pidof chrome`; do kill -9 $i; done
4027 4012 3998 3984 3924 3283 3251 3199 3117 3078 2772 2757 2752 2737 2733 2699 2660 2654 2582 2568 2556
for i in `pidof chrome`; do kill -9 $i; done
piątek, 27 listopada 2015
czwartek, 26 listopada 2015
Docker Hello World
└──╼ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from hello-world
3f12c794407e: Pull complete
975b84d108f1: Pull complete
hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
Status: Downloaded newer image for hello-world:latest
Hello from Docker.
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/userguide/
Unable to find image 'hello-world:latest' locally
latest: Pulling from hello-world
3f12c794407e: Pull complete
975b84d108f1: Pull complete
hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
Status: Downloaded newer image for hello-world:latest
Hello from Docker.
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/userguide/
wtorek, 24 listopada 2015
niedziela, 22 listopada 2015
Full TCP echo server build base on nc
ncat -v -l -p 5555 -c 'while true; do read i && echo [echo] $i; done'
while true; do nc -l 8888 < page.html; done
sobota, 14 listopada 2015
Types of killings - Kill Linux process
marek ~ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
16) SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ
26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR
31) SIGSYS 34) SIGRTMIN 35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3
38) SIGRTMIN+4 39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8
43) SIGRTMIN+9 44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7
58) SIGRTMAX-6 59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2
63) SIGRTMAX-1 64) SIGRTMAX
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
16) SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ
26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR
31) SIGSYS 34) SIGRTMIN 35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3
38) SIGRTMIN+4 39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8
43) SIGRTMIN+9 44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7
58) SIGRTMAX-6 59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2
63) SIGRTMAX-1 64) SIGRTMAX
How to list all user process in linux
pgrep -u marek -l
marek ~ pgrep -u marek -l
1548 systemd
1550 (sd-pam)
1553 sh
1560 dbus-launch
1561 dbus-daemon
1626 imsettings-daem
1630 gvfsd
1637 xfconfd
1700 ssh-agent
1724 xfce4-session
1729 gpg-agent
1731 xfwm4
1735 xfce4-panel
1737 Thunar
1739 xfdesktop
1740 nm-applet
1741 polkit-gnome-au
1742 xscreensaver
1745 xfsettingsd
marek ~ pgrep -u marek -l
1548 systemd
1550 (sd-pam)
1553 sh
1560 dbus-launch
1561 dbus-daemon
1626 imsettings-daem
1630 gvfsd
1637 xfconfd
1700 ssh-agent
1724 xfce4-session
1729 gpg-agent
1731 xfwm4
1735 xfce4-panel
1737 Thunar
1739 xfdesktop
1740 nm-applet
1741 polkit-gnome-au
1742 xscreensaver
1745 xfsettingsd
...
...
środa, 4 listopada 2015
Unix File Permission's
File Permissions:
r=4
w=2
x=1
in every group. Your example is 6(r+w=4+2)4(r=4)4(r=4).-rw-r--r-- 1 root root 436644612 Nov 4 12:30 jbfsw-60-6.0.0.102.rpm
4+2/4/4
chmod 644 jbfsw-60-6.0.0.102.rpm
niedziela, 1 listopada 2015
change xterm to terminal in geany gnome and xfce
Its good. default geany teminal setting is-
xterm -e "/bin/sh %c"
change it to-
gnome-terminal -x "/bin/sh" %c
It works, 100%
xfce:/usr/bin/exo-open --launch TerminalEmulator "/bin/sh %c"
How to serve file from different location - python http
pushd /x01/tecmint/; python –m SimpleHTTPServer 9999; popd;
Subskrybuj:
Posty (Atom)