19 Ekim 2017 Perşembe

update-alternatives komutu - JDK'ları Yönetir

Giriş
Birden fazla JDK sürümünü yönetebilmeyi sağlar. Bu komut yerine SDKMAN tercih edilebilir

--list seçeneği
Örnek
Şöyle yaparız
$ update-alternatives --list java
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
/usr/lib/jvm/jdk-11.0.3+7/bin/java
--install seçeneği
Örnek
Şöyle yaparız
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_152/bin/java 100
--remove seçeneği
Örnek
Şöyle yaparız
$ sudo update-alternatives --remove "java" /usr/lib/jvm/jdk-11.0.3+7/bin/java
update-alternatives: removing manually selected alternative - switching java to auto mode


18 Ekim 2017 Çarşamba

bash kodlama - backslash

Giriş
backslash özel bazı karakterlerden önce geliyorsa -escape diyelim- farklı yorumlanır. Bu özel karakterler şunlar
$ ` " \ ve newline

Çift Tırnak
Şöyle yaparız. Escape yapılmadığı için aynı çıktıyı alırız
[user@linux ~]$ echo "foo \ "
foo \
Şöyle yaparız. Escape yapıldığı için özel karakteri görürüz.
[user@linux ~]$ echo "foo \" "
foo "
[user@linux ~]$ echo "foo \\ "
foo \
Çift Tırnak Olmadan
Şöyle yaparız. Line continuation anlamına gelir.
[user@linux ~]$ echo foo \ # Space after \
foo

16 Ekim 2017 Pazartesi

PuTTY

reset
Açıklaması şöyle
When invoked as reset, tset sets cooked and echo modes, turns off cbreak and raw modes, turns on newline translation and resets any unset special characters to their default values before doing the terminal initialization described above. This is useful after a program dies leaving a terminal in an abnormal state.
Şöyle yaparız
ubuntu@db200krctc:~$ ubuntu@db200krctc:~$ ubuntu@db200krctc:~$ ubuntu@db200krctc:~$
ubuntu@db200krctc:~$ reset
ubuntu@db200krctc:~$
ubuntu@db200krctc:~$
ubuntu@db200krctc:~$

1 Ekim 2017 Pazar

pgrep komutu

Örnek
Şöyle yaparız.
$ pstree -pa $(pgrep systemctl)
-l seçeneği
Örnek
Şöyle yaparız
$ pgrep -l 'clamd|dockerd|snapd'
1952 snapd
1989 clamd
2085 dockerd
2813 dockerd

29 Eylül 2017 Cuma

wine

.wine dizini
Tüm bilgiler burada saklanır. Açıklaması şöyle
The .wine folder is where everything "wine" is stored including settings and the emulated file system, the "virtual C." as you called it.
Komut Satırı
Komutu satırından wine'ı çalıştırmak için şöyle yaparız.
wine /path/to/your/exe/program.exe
Burada path'i verirken dikkatli olmak lazım. Uygulamalar şuna benzer bir yere kuruludur.
~/.wine/drive_c/...
Uygulamamız şu dizinde olsun
~/.wine/drive_c/program_files/Internet Explorer
Çalıştırmak için şöyle yaparız.
wine "c:\program files\internet explorer\iexplore.exe"

23 Eylül 2017 Cumartesi

Samba

Giriş
Samba bir dosya paylaşım protokolü. Açıklaması şöyle
Meanwhile, in the Windows world, Microsoft implemented their own sharing system called SMB. Of course, it was hated by all Linux users, who would swear their lives on NFS. But SMB was not architected as a single-purpose utility. Everything was carefully considered: users, locking, conflict resolution and collaboration. The shares were not files as nothing is a file in Windows, but objects having full and useful hierarchical descriptions, capturing all the required information about how the share should behave on another computer.

SMB off the bat had its own set of users. If you wanted to get a file, you needed to log in to the SMB server with the proper credentials. These credentials would define exactly what access you have, and how far you can go with it. They would also not need a unified user system across the whole network. You could use it of course if it were available with an Active Directory server, but it was not required.

Internet'e Açmak
Samba'yı internete açmak iyi bir fikir değil. FTP veya WebDAV kullanmak daha iyi.

Windows
Windows Samba protokolünü destekler.

Portlar
Açıklaması şöyle
Samba listens to ports below 1024 (135, 445 namely), and convention requires that only root can bind ports below 1024.

13 Eylül 2017 Çarşamba

arping komutu

Giriş
En basit hali şöyledir.
arping 192.168.42.2
-c seçeneği
Şöyle yaparız.
$ sudo arping -c 2 -S 0.0.0.0 -D -i eth0 172.16.100.40
ARPING 172.16.100.40
60 bytes from 00:ae:de:ad:be:ef (172.16.100.40): index=0 time=3.513 msec
60 bytes from 00:ae:de:ad:be:ef (172.16.100.40): index=1 time=2.778 msec
-I seçeneği
Şöyle yaparız.
arping 192.168.42.2 -I eth0