یک تجربه: در دبیان ۹ برای اینکه firmware کارت شبکه یو اس بی رو بشناسانیم از روش زیر استفاده میکنیم
add to /etc/apt/source.list
deb http://ftp.fr.debian.org/debian jessie main contrib non-free
deb http://httpredir.debian.org/debian/ stretch main contrib non-free
sudo apt-get install debian-reference
apt-get update && apt-get install firmware-iwlwifi
sudo apt-get update && apt-get install firmware-iwlwifi
sudo apt-get update && sudo apt-get install firmware-iwlwifi
sudo apt-get install modplug-tools
sudo apt-get install modprobe
sudo apt-get install modprob
sudo apt-get install kmod
sudo apt-get install wicd
sudo apt-get install firmware-realtek
sudo apt-get install firmware-iwlwifi
sudo apt-get install firmware-linux
sudo apt-get install amd64-microcode firmware-linux-nonfree firmware-misc-nonfree
LINK
select
case
when b.table_name is null then
'unindexed'
else
'indexed'
end as status,
a.table_name as table_name,
a.constraint_name as fk_name,
a.fk_columns as fk_columns,
b.index_name as index_name,
b.index_columns as index_columns
from
(
select
a.table_name,
a.constraint_name,
listagg(a.column_name, ',') within
group (order by a.position) fk_columns
from
dba_cons_columns a,
dba_constraints b
where
a.constraint_name = b.constraint_name
and
b.constraint_type = 'R'
and
a.owner = '&&schema_owner'
and
a.owner = b.owner
group by
a.table_name,
a.constraint_name
) a
,(
select
table_name,
index_name,
listagg(c.column_name, ',') within
group (order by c.column_position) index_columns
from
dba_ind_columns c
where
c.index_owner = '&&schema_owner'
group by
table_name,
index_name
) b
where
a.table_name = b.table_name(+)
and
b.index_columns(+) like a.fk_columns || '%'
order by
1 desc, 2;
notify-send 'title' 'message'
notify-send -u critical "job complete"
zenity --timeout=180 --notification --text "salam behrooooooooooooooz"
zenity --error --text="An error occurred\!" --title="Warning\!"
find /usr | zenity --progress --pulsate --auto-close --auto-kill --text="Working."
zenity --question --text="Do you wish to continue/?"
zenity \
--info \
--text="<span size=\"xx-large\">Time is $(date +%Hh%M).</span>\n\nGet your <b>coffee</b>." \
--title="Coffee time" \
--ok-label="Sip"
my_variable=$(zenity --entry --text="What's my variable:");echo $my_variable
zenity --calendar
whiptail --title "Example Dialog" --msgbox "This is an example of a message box. You must hit OK to continue." 8 78
echo My text | yad \
--text-info \
--width=400 \
--height=200
yad \
--title="Desktop entry editor" \
--text="Simple desktop entry editor" \
--form \
--field="Type:CB" \
--field="Name" \
--field="Generic name" \
--field="Comment" \
--field="Command:FL" \
--field="Icon" \
--field="In terminal:CHK" \
--field="Startup notify:CHK" "Application" "Name" "Generic name" "This is the comment" "/usr/bin/yad" "yad" FALSE TRUE \
--button="WebUpd8:2" \
--button="gtk-ok:0" \
--button="gtk-cancel:1"
gksudo lsof
gksudo lsof | zenity --text-info --width 530
LINK1
Link2
Link3
Link4
Link5
Link6
sudo apt-get install ntp
sudo yum install ntp
sudo vim /etc/ntp.conf
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
sudo /etc/init.d/ntpd restart
$ ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
*198.60.22.240 .GPS. 1 u 912 1024 377 0.488 -0.016 0.098
+199.104.120.73 .GPS. 1 u 88 1024 377 0.966 0.014 1.379
-155.98.64.225 .GPS. 1 u 74 1024 377 2.782 0.296 0.158
-137.190.2.4 .GPS. 1 u 1020 1024 377 5.248 0.194 0.371
-131.188.3.221 .DCFp. 1 u 952 1024 377 147.806 -3.160 0.198
-217.34.142.19 .LFa. 1 u 885 1024 377 161.499 -8.044 5.839
-184.22.153.11 .WWVB. 1 u 167 1024 377 65.175 -8.151 0.131
+216.218.192.202 .CDMA. 1 u 66 1024 377 39.293 0.003 0.121
-64.147.116.229 .ACTS. 1 u 62 1024 377 16.606 4.206 0.216
sudo yum install ntpدر دستور بالا عبارت last_event اهمیت دارد که آبا سرور در دسترس قرار دارد یا خیر و این که در ستون reach عبارت yes هست یا no (yes یعنی از سرور مورد نظر در حال گرفتن دیتا است)
$ ntpq -c peer -c as -c rl
remote refid st t when poll reach delay offset jitter
==============================================================================
. 10.200.108.62 2 u 20 64 1 0.537 1.660 0.000
. .INIT. 16 u - 64 0 0.000 0.000 0.000
ind assid status conf reach auth condition last_event cnt
===========================================================
1 15488 9024 yes yes none reject reachable 2
2 15489 8011 yes no none reject mobilize 1
associd=0 status=c012 leap_alarm, sync_unspec, 1 event, freq_set,
version="ntpd 4.2.6p5@1.2349-o Fri Jul 22 17:30:51 UTC 2016 (1)",
processor="x86_64", system="Linux/3.16.0-4-amd64", leap=11, stratum=16,
precision=-23, rootdelay=0.000, rootdisp=0.300, refid=INIT,
reftime=00000000.00000000 Mon, Jan 1 1900 3:25:44.000,
clock=dd970af2.38da6724 Sun, Oct 22 2017 15:47:54.222, peer=0, tc=3,
mintc=3, offset=0.000, frequency=5.387, sys_jitter=0.000,
clk_jitter=0.000, clk_wander=0.000
$ ntpq
ntpq> as
ind assid status conf reach auth condition last_event cnt
===========================================================
1 45592 9444 yes yes none candidate reachable 4
2 45593 962a yes yes none sys.peer sys_peer 2
3 45594 9414 yes yes none candidate reachable 1
ntpq> exit
$
LINK
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example
# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will
# pick a different set every time it starts up. Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
##restrict -4 default kod notrap nomodify nopeer noquery
##restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
#restrict 192.168.0.0 mask 255.255.252.0
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
server address [key key | autokey] [burst] [iburst] [version version] [prefer] [minpoll minpoll] [maxpoll maxpoll]
peer address [key key | autokey] [version version] [prefer] [minpoll minpoll] [maxpoll maxpoll]
broadcast address [key key | autokey] [version version] [minpoll minpoll] [ttl ttl]
manycastclient address [key key | autokey] [version version] [minpoll minpoll [maxpoll maxpoll] [ttl ttl]
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
در سیستم عامل لینوکس شما قالبیت این را دارید که از محیط گرافیکی دلخواه خود استفاده نمایید: (
URL)
محیط کاربری اول:
MATE
در سه حالت زیر میتوانید نصب نمایید:
mate-desktop-environment-extras (full + extras) : This will install the complete MATE desktop including a few extras.
mate-desktop-environment (full) : This will install the complete MATE desktop environment.
mate-desktop-environment-core (core only) : This is a minimalist MATE installation
If no graphical environment was present before, you will also need to install a display manager such as GDM or LightDM.
نکته: شاید لازم باشد بسته زیر را نیز نصب نمایید:
apt-get install xinit
محیط کاربری دوم:
Gnome
tasksl : Debian's selection of applications
gnome : The full GNOME environment, including applications that are not officially part of the Upstream GNOME releases.
It provides the recommended GNOME environment for Debian.
gnome-desktop-environment : The official upstream GNOME environment, minus a few packages.It is the closest to upstream recommendations.
gnome-core : Only the official core” modules of the GNOME desktop. Above packages depend on this one.
Xfce
محیط چهارم کاربری:
LXDE
محیط کاربری پنجم(پلاسما):
KDE
رفع مشکل bad gateway
گاهی اوقات ممکن است بدون دلیل مشخص صفحات، خطای bad gateway بدهد.
برای حل این مشکل میبایست به لاگ خطا در نشانی /var/log/nginx/error.log مراجعه کرد. اگر مشکل به صورت زیر باشد:
upstream sent too big header while reading response header from upstream,
میبایست در در تنظیمات کانفیگ (/etc/nginx/nginx.conf) سه خط زیر را نیز اضافه نمود:
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
نکته: سرویس NginX همانند سرویس آپاچی در لینوکس و سرویس IIS در ویندوز است که یک وب سرور به ما میدهد تا بتوانیم در بستر آن صفحات وب را به اشتراک بگذاریم
نصب: از دستورات package manager سیستم عامل استفاده نمایید
Debian: sudo apt-get install nginx
CentOS: sudo yum install nginx
نکته: فایل های تنظیماتی سرویس NginX در مسیر etc/nginx قرار دارد
در فایل زیر:
/etc/nginx/nginx.conf
در خطی که با عبارت include آغاز میشود، مسیر زیر را مطابق نمونه قرار بدهید (در مسیر زیر برای هر دامنه یک فایل تنظیماتی بسازیم و کانفیگ هر سایت و یا دامنه را مجزا درون آن قرار دهید)
include /etc/nginx/site_available/*.conf;
یعنی در مسیر site_available به ازای هر فایلی که با پسوند conf وجود دارد و محتوی کانفیگ یک دامنه دلخواه است آن فایل خوانده میشود و یک دامنه را کانفیگ میکند.
بطور مثال برای دامنه BMS از فایل BMS.conf در مسیر site-available که در رهنگر مورد استفاده قرار میگرفته استفاده شد.
تمپلیت خوب برای استفاده در هر دامنه جدید:
upstream backend1 {
ip_hash;
server 172.16.85.237:8080 max_fails=3 fail_timeout=15s;
server 172.16.85.238:8080 max_fails=3 fail_timeout=15s;
}
server {
listen 80;
server_name 172.16.85.244;
client_max_body_size 250M;
location / {
proxy_set_header X-Forwarded-Proto http;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://backend1;
rewrite ^/$ /Ganjeh last;
}
}
نکته: کانفیگ بالا در فایل موجود در Site-available قرار خواهد گرفت.
بعنوان مثال برای فایل BMS.conf در رهنگر مشهد از شکل زیر استفاده شد:
#pstream backend {
# server 127.0.0.1:8080 ;
#}
server {
listen 80;
server_name 188.253.0.16;
server_name mashhad.etrack.ir;
location / {
proxy_set_header X-Forwarded-Proto http;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8080/BMS;
}
location /BMS {
proxy_set_header X-Forwarded-Proto http;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8080/BMS;
}
location /MapCache {
proxy_set_header X-Forwarded-Proto http;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8080/MapCache;
}
}
برای راه اندازی سرویس https در Nginx به روش زیر عمل کنید:
نکته: در هرباری که تغییری در تنظیمات انجام میدهید از دستور زیر استفاده نمایید تا مطمئن شوید که تغییرات درست بوده و موجب خطا نمیشود(سرویس را ریست ننمایید و از دستور زیر استفاده نمایید)
nginx -t
در زیر یک نمونه فایل config قبل ازآعمال تغییرات آورده شده تا تغییرات بوضوح مشاهده شود:
server {
listen 80;
server_name minitapp.ir;
server_name www.minitapp.ir;
client_max_body_size 300M;
location / {
proxy_pass http://192.168.2.101:8080/;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
}
}
همچنین بلاک زیر بعد از بروز تغییرات میباشد:
server {
listen 80; # http port
server_name minitapp.ir; # domain
server_name www.minitapp.ir;
client_max_body_size 300M;
return 301 https://$server_name$request_uri; # Redirect to (return301 means redirect)
}
server {
listen 443; # https port
server_name minitapp.ir; # domain
server_name www.minitapp.ir; # domain
client_max_body_size 300M;
ssl on;
ssl_certificate /etc/nginx/sites-cert/minitapp.ir.pem; # Pem(CertificateFile) file
ssl_certificate_key /etc/nginx/sites-cert/minitapp.ir.key; # Key(CertificateFile) file
ssl_session_timeout 5m; # Optional
ssl_protocols TLSv1; # Optional
ssl_ciphers HIGH:!aNULL:!MD5; # Optional
ssl_prefer_server_ciphers on; # Optional
location / {
proxy_pass http://192.168.2.101:8080/;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
}
}
نکته: مسیر زیر یک مسیر دلخواه است که در سرور Nginx است که برای نگهداری فایل های ca در نظر گرفته شده است
/etc/nginx/sites-cert
نکته: return 301 به معنی این است که صفحات را به آدرس مورد نظر منتقل(redirect) کن
نکته: اگر بخواهیم فقط از سرویس https استفاده نماییم باید از داخل بلاک server با پورت 80 تمامی location ها را پاک کرده و به یک بلاک جدید با همان نام server و با شماره 443 (بجای 80) قرار دهیم (توجه شود که هیچ مقداری در location ها تغییر نخواهند کرد)-(توجه شود که directive با عنوان proxy در تگ http مشاهده نشود)
نکته: اگر بخواهیم از هردو پروتکل http و https استفاده نماییم، آنگاه خط return 301 را از محل listen 80 حذف کرده و به بلاک های آن دست نمیزنیم.
By default if we run the ss command with no further options specified it will display a list of open non-listening sockets that have established connections, so for example TCP, UDP or UNIX sockets.
[root@centos7 ~]# ss | head -n 5 Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port u_str ESTAB 0 0 * 23740 * 23739 u_str ESTAB 0 0 * 23707 * 23706 u_str ESTAB 0 0 * 87021 * 88383 u_str ESTAB 0 0 * 17056 * 17112
In the above example I have limited the output, on my server I have over 500 lines printed out by running the ss command, so you may wish to pipe it into something like less to easily read it, or otherwise append additional options on the end to only show what you’re after.
Rather than listing all sockets, we can use the -l option to specifically list the sockets that are currently listening for a connection.
[root@centos7 ~]# ss -lt State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 2 *:kerberos-adm *:* LISTEN 0 128 *:sunrpc *:* LISTEN 0 5 *:kpasswd *:* LISTEN 0 10 192.168.1.14:domain *:* LISTEN 0 10 127.0.0.1:domain *:* LISTEN 0 5 192.168.122.1:domain *:* LISTEN 0 128 *:ssh *:*
In this example we have also used the -t option to only list TCP, more on this later. In future examples you will see that we will combine multiple options like this in order to quickly filter down to what we’re after.
We can print out the process or PID number that owns a socket with the -p option.
[root@centos7 ~]# ss -pl Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port tcp LISTEN 0 128 :::http :::* users:(("httpd",pid=10522,fd=4),("httpd",pid=10521,fd=4),("httpd",pid=10520,fd=4),("httpd",pid=10519,fd=4),("httpd",pid=10518,fd=4),("httpd",pid=10516,fd=4))
In the above example I have only listed a single result, without any further options the full output of ss prints out over 500 lines to stdout. Regardless, we can see the process ID’s of the various Apache processes that are running on this server.
By default ss will only resolve port numbers as we have previously seen, for example in the line below we can see 192.168.1.14:ssh where ssh is listed as the local port.
[root@centos7 ~]# ss Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port tcp ESTAB 0 64 192.168.1.14:ssh 192.168.1.191:57091
However if we specify the -n option, this resolution will not take place and we will instead see the port number rather than the service name.
[root@centos7 ~]# ss -n Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port tcp ESTAB 0 0 192.168.1.14:22 192.168.1.191:57091
Note that :22 is now displayed rather than :ssh as we have disabled all name resolution of hostnames and ports. You can check the /etc/services file to see a full list of which ports map to which services.
We can also do the opposite of this and resolve both the IP address and port number with the -r option. With this we now see the hostname of the 192.168.1.14 server listed.
[root@centos7 ~]# ss -r Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port tcp ESTAB 0 64 centos7.example.com:ssh 192.168.1.191:57091
We can use the -4 option to only display information corresponding to IPv4 sockets. In the below example we also make use of the -l option to list everything listening on an IPv4 address.
[root@centos7 ~]# ss -l4 Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port udp UNCONN 0 0 127.0.0.1:323 *:* udp UNCONN 0 0 192.168.122.1:domain *:* udp UNCONN 0 0 *%virbr0:bootps *:* udp UNCONN 0 0 *:bootpc *:* tcp LISTEN 0 128 *:sunrpc *:* tcp LISTEN 0 5 192.168.122.1:domain *:* tcp LISTEN 0 128 *:ssh *:* tcp LISTEN 0 128 127.0.0.1:ipp *:* tcp LISTEN 0 100 127.0.0.1:smtp *:*
Likewise, we can use the -6 option to only display information related to IPv6 sockets. In the below example we also make use of the -l option to list everything listening on an IPv6 address.
[root@centos7 ~]# ss -l6 Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port udp UNCONN 0 0 :::ipv6-icmp :::* udp UNCONN 0 0 :::22834 :::* udp UNCONN 0 0 ::1:323 :::* tcp LISTEN 0 128 :::sunrpc :::* tcp LISTEN 0 128 :::http :::* tcp LISTEN 0 128 :::ssh :::* tcp LISTEN 0 128 ::1:ipp :::* tcp LISTEN 0 100 ::1:smtp :::*
The -t option can be used to display only TCP sockets. When combined with -l to only print out listening sockets we can see everything listening on TCP.
[root@centos7 ~]# ss -lt State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:sunrpc *:* LISTEN 0 5 192.168.122.1:domain *:* LISTEN 0 128 *:ssh *:* LISTEN 0 128 127.0.0.1:ipp *:* LISTEN 0 100 127.0.0.1:smtp *:* LISTEN 0 128 :::sunrpc :::* LISTEN 0 128 :::http :::* LISTEN 0 128 :::ssh :::* LISTEN 0 128 ::1:ipp :::* LISTEN 0 100 ::1:smtp :::*
The -u option can be used to display only UDP sockets. As UDP is a connection-less protocol, simply running with only the -u option will display no output. We can instead combine this with the -a or -l option to see all listening UDP sockets, as shown below.
[root@centos7 ~]# ss -ul State Recv-Q Send-Q Local Address:Port Peer Address:Port UNCONN 0 0 *:mdns *:* UNCONN 0 0 *:kpasswd *:* UNCONN 0 0 *:839 *:* UNCONN 0 0 *:36812 *:* UNCONN 0 0 192.168.122.1:domain *:* UNCONN 0 0 192.168.1.14:domain *:*
The -x option can be used to display unix domain sockets only.
[root@centos7 ~]# ss -x Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port u_str ESTAB 0 0 @/tmp/.X11-unix/X0 27818 * 27817 u_str ESTAB 0 0 @/tmp/.X11-unix/X0 26656 * 26655 u_str ESTAB 0 0 * 28344 * 26607 u_str ESTAB 0 0 * 24704 * 24705 u_str ESTAB 0 0 @/tmp/.X11-unix/X0 25195 * 24086 u_str ESTAB 0 0 @/tmp/dbus-CRqRiw6V 28388 * 28693 .
the -a option shows all, both listening and non-listening sockets. In the case of TCP this means established connections. This option is useful for combining with others, for instance to show all UDP sockets we can add -a, as by default with just the -u option we don’t see as much information.
[root@centos7 ~]# ss -u Recv-Q Send-Q Local Address:Port Peer Address:Port 0 0 192.168.1.14:56658 129.250.35.251:ntp [root@centos7 ~]# ss -ua State Recv-Q Send-Q Local Address:Port Peer Address:Port UNCONN 0 0 *:mdns *:* UNCONN 0 0 127.0.0.1:323 *:* ESTAB 0 0 192.168.1.14:56658 129.250.35.251:ntp UNCONN 0 0 *:21014 *:* UNCONN 0 0 *:60009 *:* UNCONN 0 0 192.168.122.1:domain *:* UNCONN 0 0 *%virbr0:bootps *:* UNCONN 0 0 *:bootpc *:* UNCONN 0 0 ::1:323 :::* UNCONN 0 0 :::43209 :::*
The -m option can be used to display the amount of memory that each socket is using.
[root@centos7 ~]# ss -ltm State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:sunrpc *:* skmem:(r0,rb87380,t0,tb16384,f0,w0,o0,bl0) LISTEN 0 5 192.168.122.1:domain *:* skmem:(r0,rb87380,t0,tb16384,f0,w0,o0,bl0) LISTEN 0 128 *:ssh *:* skmem:(r0,rb87380,t0,tb16384,f0,w0,o0,bl0) LISTEN 0 128 127.0.0.1:ipp *:* skmem:(r0,rb87380,t0,tb16384,f0,w0,o0,bl0) LISTEN 0 100 127.0.0.1:smtp *:* skmem:(r0,rb87380,t0,tb16384,f0,w0,o0,bl0)
We can request additional internal TCP information with the -i info option.
[root@centos7 ~]# ss -lti State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:sunrpc *:* cubic rto:1000 mss:536 cwnd:10 lastsnd:373620 lastrcv:373620 lastack:373620 LISTEN 0 5 192.168.122.1:domain *:* cubic rto:1000 mss:536 cwnd:10 lastsnd:373620 lastrcv:373620 lastack:373620 LISTEN 0 128 *:ssh *:* cubic rto:1000 mss:536 cwnd:10 segs_in:2 lastsnd:373620 lastrcv:373620 lastack:373620 LISTEN 0 128 127.0.0.1:ipp *:* cubic rto:1000 mss:536 cwnd:10 lastsnd:373620 lastrcv:373620 lastack:373620 LISTEN 0 100 127.0.0.1:smtp *:* cubic rto:1000 mss:536 cwnd:10 lastsnd:373620 lastrcv:373620 lastack:373620
Underneath each listening socket we can see additional information. Note that the -i option does not work with UDP, if you instead specify -u instead of -t this extra information will not be present.
We can see a quick overview of the statistics with the -s option.
[root@centos7 ~]# ss -s Total: 1253 (kernel 1721) TCP: 13 (estab 1, closed 2, orphaned 0, synrecv 0, timewait 0/0), ports 0 Transport Total IP IPv6 * 1721 - - RAW 1 0 1 UDP 9 7 2 TCP 11 6 5 INET 21 13 8 FRAG 0 0 0
This quickly allows us to see things like the total number of established connections, as well as counts of each type of socket and whether IPv4 or IPv6 is in use.
We can specify the state of a socket to only print out sockets in this state. For example we can specify states including established, syn-sent, syn-recv, fin-wait-1, fin-wait-2, time-wait, closed, closed-wait, last-ack, listen and closing. The below example shows all established TCP connections. To generate this I was connected to the server by SSH and just loaded a web page from Apache. We can then see that the connections to Apache quickly change to time-wait.
[root@centos7 ~]# ss -t state established Recv-Q Send-Q Local Address:Port Peer Address:Port 0 64 192.168.1.14:ssh 192.168.1.191:57091 0 0 ::ffff:192.168.1.14:http ::ffff:192.168.1.191:57373 0 0 ::ffff:192.168.1.14:http ::ffff:192.168.1.191:57372 [root@centos7 ~]# ss -t state time-wait Recv-Q Send-Q Local Address:Port Peer Address:Port 0 0 ::ffff:192.168.1.14:http ::ffff:192.168.1.191:57373 0 0 ::ffff:192.168.1.14:http ::ffff:192.168.1.191:57372
Filtering can also be performed to list all ports that are less than (lt), greater than (gt), equal to (eq), not equal to (ne), less than or equal to (le), or greater than or equal to (ge).
For example, the below command shows all listening ports on port number 500 or below.
[root@centos7 ~]# ss -ltn sport le 500 State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:111 *:* LISTEN 0 5 192.168.122.1:53 *:* LISTEN 0 128 *:22 *:* LISTEN 0 100 127.0.0.1:25 *:* LISTEN 0 128 :::111 :::* LISTEN 0 128 :::22 :::* LISTEN 0 100 ::1:25 :::*
For comparison we can perform the opposite, and view all ports greater than 500 with ‘gt’
[root@centos7 ~]# ss -ltn sport gt 500 State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 127.0.0.1:631 *:* LISTEN 0 128 ::1:631 :::*
We can also filter based on items such as source or destination port, for example below we search for TCP sockets that have a source port (sport) of ssh.
[root@centos7 ~]# ss -t '( sport = :ssh )' State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 64 192.168.1.14:ssh 192.168.1.191:57091
The -Z and -z options can be used to show the SELinux security context of a socket. In the example below we also use the -t and -l options to only list listening TCP sockets, with the -Z option we can also see the SELinux contexts.
[root@centos7 ~]# ss -tlZ State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:sunrpc *:* users:(("systemd",pid=1,proc_ctx=system_u:system_r:init_t:s0,fd=71)) LISTEN 0 5 192.168.122.1:domain *:* users:(("dnsmasq",pid=1810,proc_ctx=system_u:system_r:dnsmasq_t:s0-s0:c0.c1023,fd=6)) LISTEN 0 128 *:ssh *:* users:(("sshd",pid=1173,proc_ctx=system_u:system_r:sshd_t:s0-s0:c0.c1023,fd=3)) LISTEN 0 128 127.0.0.1:ipp *:* users:(("cupsd",pid=1145,proc_ctx=system_u:system_r:cupsd_t:s0-s0:c0.c1023,fd=12)) LISTEN 0 100 127.0.0.1:smtp *:* users:(("master",pid=1752,proc_ctx=system_u:system_r:postfix_master_t:s0,fd=13))
The -v option can be used to display specific version information for the ss command, in this instance we see the version of the iproute package which provides ss.
[root@centos7 ~]# ss -v ss utility, iproute2-ss130716
The -h option can be used to display further help regarding the ss command, it’s good to use as a quick reference if you need a short description on some of the most commonly used options. Note that the full output here has not been included for brevity.
[root@centos7 ~]# ss -h Usage: ss [ OPTIONS ]
We can use the -e option which shows extended detailed information, as shown below we can see the extended information appended to the end of each line.
[root@centos7 ~]# ss -lte State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:sunrpc *:* ino:16090 sk:ffff880000100000 <-> LISTEN 0 5 192.168.122.1:domain *:* ino:23750 sk:ffff880073e70f80 <-> LISTEN 0 128 *:ssh *:* ino:22789 sk:ffff880073e70000 <-> LISTEN 0 128 127.0.0.1:ipp *:* ino:23091 sk:ffff880073e707c0 <-> LISTEN 0 100 127.0.0.1:smtp *:* ino:24659 sk:ffff880000100f80 <->
The -o option can be used to display the timer information. This information shows us things such as the retransmission timer value, number of retransmissions that have occurred, and the number of keepalive probes that have been sent.
[root@centos7 ~]# ss -to State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 64 192.168.1.14:ssh 192.168.1.191:57091 timer:(on,242ms,0) ESTAB 0 0 ::ffff:192.168.1.14:http ::ffff:192.168.1.191:57295 timer:(keepalive,120min,0) ESTAB 0 0 ::ffff:192.168.1.14:http ::ffff:192.168.1.191:57296 timer:(keepalive,120min,0)
به دو صورت میتوان یک یوزر را sudo نماییم:
روش اول:
فایل زیر را ادیت کرده و خط زیر را در آن قرار دهید:
# vim /etc/sudoers(or sudo visudo)
behrooz ALL=(ALL) ALL
در خط بالا که به فایل /etc/sudoers اضافه میشود behrooz نام یوزر است
behrooz indicates user name
First ALL instructs to permit sudo access from any terminal/machine
Second (ALL) instructs sudo command to be allowed to execute as any user
Third ALL indicates all command can be executed as root
برای نصب برنامه pycharm که یک ادیتور هست که کد پایتون را کامپایل میکند به روش زیر عمل میکنیم(نصب در دبیان9)
نکته: از لینک آخر این دایکومنت برای نصب در توزیعهای دیگر نیز میتوانید استفاده نمایید
گام اول: بارگردن آدرس
URL
گام دوم: instal this package
گام سوم: select opration sysstem
گام چهارم: select server to download
گام پنجم:
sudo apt-get install pycharm-community-sloppy
URL1
URL2
URL3
deb http://site.example.com/debian distribution component1 component2 component3
deb-src http://site.example.com/debian distribution component1 component2 component3
deb: دانلود بسته هایی از جنس باینری که کامپایل شده است.
deb-src: دانلود بسته هایی از جنس کد میباشد
url: لینک دانلود کردن بستهها(here)
Distribution: نام ورژن دبیان-(Buster دبیان10)(Stretch دبیان9)(Jessie دبیان8)(Stable مثلا داریم از دبیان9 استفاده میکنیم و میخواهیم وقتی دبیان10 آمد به آن سوییچ شود)
components
در زیر یک نمونه از فایل source.list که از سیستم عامل دبیان ۹ است آورده شده است:
deb http://deb.debian.org/debian stretch main deb-src http://deb.debian.org/debian stretch main deb http://deb.debian.org/debian stretch-updates main deb-src http://deb.debian.org/debian stretch-updates main deb http://security.debian.org/debian-security/ stretch/updates main deb-src http://security.debian.org/debian-security/ stretch/updates main
نکته: اگر بخواهید از بستههای contrib و non-free استفاده نمایید، میتوانید پس از main یک فاصله گذاشته و به ترتیب عبارت contrib و non-free را تایپ نمایید
نکته: اگر بخواهید موارد بالا را به حالت گرافیکی تنظیم نمایید از دستور زیر استفاده نمایید:
sudo gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk
جستجو در عبارت است نظیر grep در لینوکس
ipconfig | findstr IP
تمام اطلاعات از کارت شبکه:
ipconfig /all
DNS های لوکال cache شده در سیستم
ipconfig /displaydns
ipconfig /flushdns
systeminfo
tasklist
بستن یک برنامه بر اساس پروسس آی دی
taskkill /PID NUMBER
نمایش متن یک فایل متنی
type FILE.txt
وضعیت و اطلاعات سوکتها و پورتها و کانکشنهای سیسیتم را نشان میدهد
netstat -a
برای start ویا stop کردن سرویسها از دستور زیر استفاده میشود:
net start SERVICE
net stop SERVICE
برای افزودن یک درارو شبکهای ویا حذف آن از دستور زیر استفاده میشود
net use m: \myserversharename
net use m: \myserversharename /delete
نکته:دستور net بسیار کارهای دیگر نیز میتواتند انجام دهد که شرح آن را در help آن مشاهده نمایید.
برای اینکه ببینید dns پیش فرض شما چه میباشد از دستور nslookup استفاده نمایید
nslookup
برای تغییر dns از پیشفرض به یک سرور دیگر ابتدا دستور nslookup را زده و سپس دستور set ds وارد کرده و اینتر را بزنید و سپس آدرس ip دی ان اس سرور مورد نظر را وارد نمایید.
nslookup
set ds
8.8.8.8
nslookup NAME 8.8.8.8.
لینک مفید
ترتیب خوانده شدن فایل های کانفیگی در دبیان 9:
20180430-155851-Profile:begin (اجرا در اول)
20180430-155851-profile:End (اجرا در دومین مرحله)
20180430-155915-bashrc:begin (اجرا در سومین مرحله)
20180430-155915-bash_alias:begin (اجرا در چهارمین مرحله)
20180430-155915-bash_alias:End (اجرا در پنجمین مرحله)
20180430-155915-bashrc:end (اجرا در ششمین مرحله)
/proc/meminfo(KB) | free -k | Status | |
MemTotal | 4040208 | 4040208 | Equal |
MemFree | 518032 | 518016 | Equal |
MemAvailable | 1582984 | 1582968 | Equal |
used | 2116340 | Total – (free + cache + buffer) | |
Buffers | 94508 | 1405852 | Equal |
Cached | 1218532 | ||
SwapTotal | 9867260 | 9867260 | Equal |
SwapFree | 9867260 | 9867260 | Equal |
swap used | 0 | ||
Shmem | 91388 | 91388 | Equal |
tar:
archive: tar -cvf File.tar /directory
Extract: tar xf FileName.tar
Tar.gz:
Archive: tar czvf name.tar.gz files
Extract: tar xzvf name.tar.gz
tar.bz2:
Archive: tar -cvjSf folder.tar.bz2 folder
Extract: tar xjf File.tar.bz2
bz2:
Archive: bzip2 -z filename
[or] Archive: bzip2 filename
Extract: bunzip2 FileName.bunzip2
[or] Extract: bzip2 -d filename.bz2
rar:
archive:
Extract: unrar e FileName.rar
gz:
Archive: gzip file
Extract: gzip -d file.gz
Extract: gunzip FileName.gz
zip:
archive: zip file.zip file
archive: zip -r Folder.zip folder
Extract: unzip File.zip
7zip:
Archive: 7z a File.7z File
Extract: 7z e File.7z
vboxmanage list hostinfo
vboxmanage list vms
vboxmanage list vms --long
vboxmanage list runningvms
vboxmanage list runningvms --long
vboxmanage showvminfo {UUID}
vboxheadless --startvm {UUID}
vboxmanage controlvm {UUID} savestate
vboxmanage controlvm {UUID} acpipowerbutton
Sample outputs (note: masked out some data with alphabets):
74.xx.yy.zz dev eth1 lladdr 00:30:48:yy:zz:ww REACHABLE
10.10.29.66 dev eth0 lladdr 00:30:48:c6:0a:d8 REACHABLE
74.ww.yyy. dev eth1 lladdr 00:1a:30:yy:zz:ww REACHABLE
10.10.29.68 dev eth0 lladdr 00:30:48:33:bc:32 REACHABLE
74.fff.uu.cc dev eth1 lladdr 00:30:48:yy:zz:ww STALE
74.rr.ww.fff dev eth1 lladdr 00:30:48:yy:zz:ww DELAY
10.10.29.65 dev eth0 lladdr 00:1a:30:38:a8:00 REACHABLE
10.10.29.74 dev eth0 lladdr 00:30:48:8e:31:ac REACHABLE
The last field show the the state of the neighbour unreachability detection” machine for this entry:
STALE – The neighbour is valid, but is probably already unreachable, so the kernel will try to check it at the first transmission.
DELAY – A packet has been sent to the stale neighbour and the kernel is waiting for confirmation.
REACHABLE – The neighbour is valid and apparently reachable.
neighbour state (nud):
permanent The neighbour entry is valid forever and can be only be removed administratively
noarp The neighbour entry is valid. No attempts to validate this entry will be made but it can be removed when its lifetime expires.
stale The neighbour entry is valid but suspicious. This option to ip neigh does not change the neighbour state if it was valid and the address is not changed by this command.
reachable The neighbour entry is valid until the reachability timeout expires.
output:192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.10
output:
2: eth0 inet 192.168.2.201/24 scope global secondary eth0
2: eth0 inet 192.168.2.200/24 scope global eth0
*** Round 1, deleting 2 addresses ***
*** Flush is complete after 1 round ***
Sample outputs:
2: eth0: mtu 9000 qdisc pfifo_fast state UP qlen 1000
link/ether 00:08:9b:c4:30:30 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.10/24 brd 192.168.1.255 scope global eth1
inet6 fe80::208:9bff:fec4:3030/64 scope link
valid_lft forever preferred_lft forever
Notice:By default, the ip command does not set any broadcast address unless explicitly requested
URL1
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\sources\sxs
URL
cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
vim /etc/selinux/config
SELINUX=enforcing
URL
vim /etc/modules-load.d/rt2800usb.conf
The output should look like this:
systemd-modules-load.service - Load Kernel Modules
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)
Active: active (exited) since Wed, 03 Apr 2013 22:50:57 +0000; 46s ago
Docs: man:systemd-modules-load.service(8)
man:modules-load.d(5)
Process: 260 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)
if status=1/FAILURE
journalctl -b
URL
CLOSED
CLOSE_WAIT
ESTABLISHED
Indicates that the server received the SYN signal from the client and the session is established
FIN_WAIT_1
FIN_WAIT_2
LAST_ACK
LISTENING
SYN_RECEIVED
SYN_SEND
TIME_WAIT
option:
-i This installs a new package(rpm -i package)
-F This will upgrade packages, but only if an earlier version currently exists(rpm -F package)
-U This upgrades or installs the package currently installed to a newer version(rpm -U package)
-e erase (uninstall) package(rpm -e package)
-q query packages(rpm -q package)
-V verify installed packages(rpm -V package)
-K verify package signature(rpm -K package)
--rebuilddb rebuild the database indices from the installed package headers(rpm --rebuilddb)
--initdb create a new database if one doesn’t already exist(rpm --initdb)
--import import PUBKEY(rpm --import /usr/share/rhn/RPM-GPG-KEY)
options with i, U:
-v show package name(rpm -iv package)
-h display progress(rpm -ivh package)
-vv Print lots of ugly debugging information(rpm -ivv package)
--nodeps Don’t do a dependency check before installing or upgrading a package(rpm -ivh --nodeps package)
--test Don’t really uninstall anything, just go through the motions(rpm -ivh --test package)
options with q:
-a Query all installed packages(rpm -qa)
-i Display package information, including name, version, and description. This uses the --queryformat if one was specified(rpm -qi) package
-l List files in package(rpm -ql package)
-c List only configuration files (implies -l)(rpm -qc package)
-d List only documentation files (implies -l)(rpm -qd package)
-f Query package owning FILE(rpm -qf /bin/bash)
-R List packages on which this package depends(rpm -qR package)
-s Display the states of files in the package (implies -l)(rpm -qs package)
--last Orders the package listing by install time such that the latest packages are at the top(rpm -q --last package)
--changelog Display change information for the package(rpm -q --changelog package)
URL
برای اطلاع پیدا کردن از اطلاعات ساختاری و تعداد کانکشنها و موارد administrator میتونیم ماژول را status_module فعال نمایید
vim httpd.conf
<Location "/server-status">
SetHandler server-status
Require host example.com
</Location>
سپس به آی پی رفته و در ادامه عبارت server-status را تایپ نمایید
127.0.0.1/server-status
systemd-resolve -t MX gmail.com #show mail server
systemd-resolve -t SOA gmail.com #show SOA . Start Of Authority (More administrative information)
URL
systemd-resolve 85.214.157.7 #Get domain name
nslookup domain.ir [#Finding The IP Address of an Host from default dns server]
nslookup domain.ir 8.8.8.8[#Finding The IP Address of an Host From non default dns server]
nslookup -querytype=mx domain.ir[ #Find Mail Servers for a Domain]
nslookup -query=mx domain.ir [#Find Mail Servers]
nslookup -query=ns domain.ir [ #Find NameServers]
nslookup -query=soa domain.ir [ #display the SOA record (information about the domain]
nslookup -query=any domain.ir [ #display all the available DNS records]
systemd-resolve --statistics #informations
URL
sudo systemd-resolve --flush-caches
sudo systemd-resolve --statistics
sudo /etc/init.d/dns-clean start
Retrieve new lists of packages
Perform an upgrade
Install new packages (pkg is libc6 not libc6.deb)
Remove packages
Remove packages and config files
Remove automatically all unused packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.
Distribution upgrade
Configure build-dependencies for source packages. install all dependencies for 'packagename'
Erase downloaded archive files. clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
Erase old downloaded archive files
Verify that there are no broken dependencies
Download source archives. Source packages are tracked separately from binary packages via deb-src lines in the sources.list.[--compile]: package will be compiled to a binary .deb using dpkg-buildpackage for the architecture as defined by the [--host-architecture] option.[--download-only]:source package will not be unpacked.
Download the binary package into the current directory
Download and display the changelog for the given packageسیاهه یا تاریخچهٔ تغییراتی که در پروژه صورت گرفته است
listing of information about all data files (index targets) apt-get update would download
در هنگام نصب، بستههای توصیهشده بعنوان وابستگی لحاظ نشوند
درهنگام نصب بستههای پیشنهاد شونده(توسط برنامه) بعنوان وابستگی لحاظ نشوند
فقط فایلهای بسته دانلود شوند(unpacked یا نصب نشوند)
تلاش برای اصلاح گسیختگیهای موجود در وابستگیهابا این گزینه به برنامه apt اجازه داده میشود تا درصورت نیاز هر بستهای را حذف نماید
Ignore missing packages; if packages cannot be retrieved or fail the integrity check after retrieval (corrupted package files), hold back those packages and handle the result. Use of this option together with -f may produce an error in some situations. If a package is selected for installation (particularly if it is mentioned on the command line) and it could not be downloaded then it will be silently held back.
Disables downloading of packages. This is best used with --ignore-missing to force APT to use only the .debs it has already downloaded.
Quiet; produces output suitable for logging, omitting progress indicators. More q's will produce more quiet up to a maximum of 2. You can also use -q=# to set the quiet level, overriding the configuration file. Note that quiet level 2 implies -y; you should never use -qq without a no-action modifier such as -d, --print-uris or -s as APT may decide to do something you did not expect.
No action; perform a simulation of events that would occur based on the current system state but do not actually change the system. Locking will be disabled (Debug::NoLocking) so the system state could change while apt-get is running. Simulations can also be executed by non-root users which might not have read access to all apt configuration distorting the simulation. A notice expressing this warning is also shown by default for non-root users (APT::Get::Show-User-Simulation-Note).Simulated runs print out a series of lines, each representing a dpkg operation: configure (Conf), remove (Remv) or unpack (Inst). Square brackets indicate broken packages, and empty square brackets indicate breaks that are of no consequence (rare).
Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package, trying to install a unauthenticated package or removing an essential package occurs then apt-get will abort.
Automatic "no" to all prompts.
Do not show a list of all packages that are to be upgraded.
Show full versions for upgraded and installed packages.
This option controls the architecture packages are built for by apt-get source --compile and how cross-builddependencies are satisfied. By default is it not set which means that the host architecture is the same as the build architecture (which is defined by APT::Architecture).
This option controls the activated build profiles for which a source package is built by apt-get source --compile and how build dependencies are satisfied. By default no build profile is active. More than one build profile can be activated at a time by concatenating them with a comma.
Compile source packages after downloading them.
Ignore package holds; this causes apt-get to ignore a hold placed on a package. This may be useful in conjunction with dist-upgrade to override a large number of undesired holds.
Allow installing new packages when used in conjunction with upgrade. This is useful if the update of a installed package requires new dependencies to be installed. Instead of holding the package back upgrade will upgrade the package and install the new dependencies. Note that upgrade with this option will never remove packages, only allow adding new ones.
Do not upgrade packages; when used in conjunction with install, no-upgrade will prevent packages on the command line from being upgraded if they are already installed.
Do not install new packages; when used in conjunction with install, only-upgrade will install upgrades for already installed packages only and ignore requests to install new packages.
This is a dangerous option that will cause apt to continue without prompting if it is doing downgrades. It should not be used except in very special situations. Using it can potentially destroy your system!
Force yes; this is a dangerous option that will cause apt to continue without prompting if it is removing essentials. It should not be used except in very special situations. Using it can potentially destroy your system!
Force yes; this is a dangerous option that will cause apt to continue without prompting if it is changing held packages. It should not be used except in very special situations. Using it can potentially destroy your system!
Force yes; this is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful. It should not be used except in very special situations. Using force-yes can potentially destroy your system!. This is deprecated and replaced by --allow-downgrades, --allow-remove-essential, --allow-change-held-packages in 1.1.
Instead of fetching the files to install their URIs are printed. Each URI will have the path, the destination file name, the size and the expected MD5 hash. Note that the file name to write to will not always match the file name on the remote site! This also works with the source and update commands. When used with the update command the MD5 and size are not included, and it is up to the user to decompress any compressed files.
Use purge instead of remove for anything that would be removed. An asterisk ("*") will be displayed next to packages which are scheduled to be purged. remove --purge is equivalent to the purge command.
Re-install packages that are already installed and at the newest version
This option is on by default; use --no-list-cleanup to turn it off. When it is on, apt-get will automatically manage the contents of /var/lib/apt/lists to ensure that obsolete files are erased. The only reason to turn it off is if you frequently change your sources list.
This option controls the default input to the policy engine; it creates a default pin at priority 990 using the specified release string. This overrides the general settings in /etc/apt/preferences. Specifically pinned packages are not affected by the value of this option. In short, this option lets you have simple control over which distribution packages will be retrieved from. Some common examples might be -t '2.1*', -t unstable or -t sid.
Only perform operations that are 'trivial'. Logically this can be considered related to --assume-yes; where --assume-yes will answer yes to any prompt, --trivial-only will answer no.
If any packages are to be removed apt-get immediately aborts without prompting.
If the command is either install or remove, then this option acts like running the autoremove command, removing unused dependency packages.
Only has meaning for the source and build-dep commands. Indicates that the given source names are not to be mapped through the binary table. This means that if this option is specified, these commands will only accept source package names as arguments, rather than accepting binary package names and looking up the corresponding source package.
Download only the diff, dsc, or tar file of a source archive.
Only process architecture-dependent build-dependencies.
Only process architecture-independent build-dependencies
Ignore if packages can't be authenticated and don't prompt about it. This can be useful while working with local repositories, but is a huge security risk if data authenticity isn't ensured in another way by the user itself. The usage of the Trusted option for sources.list(5) entries should usually be preferred over this global override.
Forbid the update command to acquire unverifiable data from configured sources. APT will fail at the update command for repositories without valid cryptographically signatures. See also apt-secure(8) for details on the concept and the implications.
Show user friendly progress information in the terminal window when packages are installed, upgraded or removed. For a machine parsable version of this data see README.progress-reporting in the apt doc directory.
Adds the given file as a source for metadata. Can be repeated to add multiple files. See --with-source description in apt-cache(8) for further details.
Configuration File; Specify a configuration file to use. The program will read the default configuration file and then this configuration file. If configuration settings need to be set before the default configuration files are parsed specify a file with the APT_CONFIG environment variable. See apt.conf(5) for syntax information.
Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be used multiple times to set different options.
Locations to fetch packages from. Configuration Item: Dir::Etc::SourceList.
File fragments for locations to fetch packages from. Configuration Item: Dir::Etc::SourceParts.
APT configuration file. Configuration Item: Dir::Etc::Main.
APT configuration file fragments. Configuration Item: Dir::Etc::Parts.
Version preferences file. This is where you would specify "pinning", i.e. a preference to get certain packages from a separate source or from a different version of a distribution. Configuration Item:[Dir::Etc::Preferences].
File fragments for the version preferences. Configuration Item: Dir::Etc::PreferencesParts.
Storage area for retrieved package files. Configuration Item: Dir::Cache::Archives.
Storage area for package files in transit. Configuration Item: Dir::Cache::Archives (partial will be implicitly appended)
Storage area for state information for each package resource specified in sources.list(5) Configuration Item: Dir::State::Lists.
Storage area for state information in transit. Configuration Item: Dir::State::Lists (partial will be implicitly appended)
list:
[--installed], [--upgradeable], [--all-versions]
list packages based on package names.list is somewhat similar to dpkg-query --list in that it can display a list of packages satisfying certain criteria.
search:
search in package descriptions
show:
show package details and information about the given package(s) including its dependencies, installation and download size, sources the package is available from, the description of the packages content and such more install, remove, purge: Performs the requested action on one or more packages specified via regex(7), glob(7) or exact match. The requested action can be overridden for specific packages by append a plus (+) to the package name to install this package or a minus (-) to remove it.
autoremove:
Remove automatically all unused packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed as dependencies changed
update:
update list of available packages
upgrade:
upgrade the system by installing/upgrading packages
full-upgrade:
upgrade the system by removing/installing/upgrading packages
edit-sources:
edit the source information file (edit your sources.list)
CLOSED: #Indicates that the server has received an ACK signal from the client and the connection is closed
CLOSE_WAIT: #[Indicates that the server has received the first FIN signal from the client and the connection is in the process of being closed]
#[So this essentially means that his is a state where socket is waiting for the application to execute close()]
#[A socket can be in CLOSE_WAIT state indefinitely until the application closes it]
#[Faulty scenarios would be like filedescriptor leak, server not being execute close() on socket leading to pile up of close_wait sockets]
ESTABLISHED: #Indicates that the server received the SYN signal from the client and the session is established
FIN_WAIT_1: #Indicates that the connection is still active but not currently being used
FIN_WAIT_2: #Indicates that the client just received acknowledgment of the first FIN signal from the server
LAST_ACK #Indicates that the server is in the process of sending its own FIN signal
LISTENING: #Indicates that the server is ready to accept a connection
SYN_RECEIVED: #Indicates that the server just received a SYN signal from the client
SYN_SEND: #Indicates that this particular connection is open and active
TIME_WAIT: #Indicates that the client recognizes the connection as still active but not currently being used
def tor_request(url, jsn=None, method="get"): session = requests.session() session.proxies = {'http': 'socks5h://localhost:9050', 'https': 'socks5h://localhost:9050'} resp = None if method == "get": resp = session.get(url=url, json=jsn) elif method == "post": resp = session.post(url=url, json=jsn) del session return resp.json()
اگر بخواهیم هر شش ثانبه کد ما آی پی جدید به خود اتخاذ نماید باید از دستور زیر استفاده نماییم:
$ vim /etc/tor/torrc #Append to end . . . MaxCircuitDirtiness 1
upgrade:گرفتن (دوباره بدست آوردن) لیست بستههای جدید
آپگرید کردن
remove:نصب یک بسته
حذف یک بسته
حذف بسته به همراه تمامی تنظیمات آن
Remove automatically all unused packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.
Distribution upgrade
Configure build-dependencies for source packages. install all dependencies for 'packagename'
Erase downloaded archive files. clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
پاک کردن فایلهای آرشیو شده از دانلودهای قبلی
Verify that there are no broken dependencies
Download source archives. Source packages are tracked separately from binary packages via deb-src lines in the sources.list.[--compile]: package will be compiled to a binary .deb using dpkg-buildpackage for the architecture as defined by the [--host-architecture] option.[--download-only]:source package will not be unpacked.
دانلود فایل باینری در مسیر فعلی
Download and display the changelog for the given packageسیاهه یا تاریخچهٔ تغییراتی که در پروژه صورت گرفته است
listing of information about all data files (index targets) apt-get update would download
در هنگام نصب، بستههای توصیهشده بعنوان وابستگی لحاظ نشوند
درهنگام نصب بستههای پیشنهاد شونده(توسط برنامه) بعنوان وابستگی لحاظ نشوند
فقط فایلها دانلود شوند(unpacked یا نصب نشوند)
تلاش برای اصلاح گسیختگیهای موجود در وابستگیهابا این گزینه به برنامه apt اجازه داده میشود تا درصورت نیاز هر بستهای را حذف نماید
نادیده گرفتن بستههای خرابی(مثلا دانلود نمیشوند یا اینکه دانلود شده اند ولی خراب هستند)اگر بستهها نمیتوانند دانلود شوند یا بعد از دانلود امکان چک و بررسی یکپارچکی وجود نداردآن بستهها را عقب نگهدار و نتیجه را هندل کناگر این سوییچ را با -f استفاده نمایید ممکن است در مواردی به ارور برخورد نماییداگر نام یک بسته در خط فرمان برای نصب آورده شده باشد درصورت عدم دانلود این بسته بدون هیچ گونه اخطاری از نصب این بسته صرف نظر میشود
فقط از بستههای deb موجود(کنونی) در سیستمعامل که پیشتر دانلود شده استفاده شود
این کامند برای تهیه لاگ بسیار مفید است زیرا نشانگرهای پیشرفت و موارد توضیحاتی را حذف میکندبا مقداردهی به -q=# میتوانیم سطح عدم تولید توضیحات را مشخص نماییم
هیچ کاری صورت نگیردشبیهسازی و نمایش در خروجی از تغییراتی که با اجرای دستور صورت خواهد گرفت
بطور اتوماتیک به هر prompt پاسخ yes خواهد دادrun non-interactivelyدر موارد نامطلوب دستور apt-get متوقف خواهد شد(نظیر: تغییر در نگهداری بسته یا نصب یک بسته غیرمجاز یا حذف یک بسته خیلی مهم)
بصورت پیشفرض به همه promp ها پاسخ no میدهد
[-V, --verbose-versions]عدم نمایش لیست تمام بستههایی که آپگرید شدهاند
[-a, --host-architecture]نمایش نسخه تمام نسخهها از بستههایی که آپگرید شدهاند
بصورت پیشفرض تنظیم نیستدر زمان استفاده از دستور apt-get source --compile معماری بستههای build شونده کنترل و cross-builddependencies تامین شوند
Compile source packages after downloading them.
Ignore package holds;بسته را نگهداری ننماید-به عبارتی پس از نصب آن را در سیستم نگهندارد
این سوییچ وقتی با دستور upgrade همراه شود دراین صورت مجاز به نصب بستههای جدید خواهد بود.این دستور زمان نیازمندی به یک dependency مفید خواهد بود تا آن نیز بتواند نصب نمایدنکته:دستور upgrade هیچگاه بستهای را حذف نمیکند و فقط بسته جدید را نصب میکند
Do not upgrade packages;همراه با دستور install : اگر بسته هماکنون نصب شده باشد آنگاه از upgrade آن دستور جلوگیری بعمل خواهد آمد
همراه با دستور install : اگر بسته هماکنون در سیستمعامل موجود نباشد، نصب صورت نگیرد
تنها زمانی بسته را آپگرید خواهد کرد که درحال حاضر بسته در سیستمعامل وجود داشته و ورژن جدید از آن در دسترس باشد
[--allow-remove-essential]این دستور خطرناک است و ممکن است به سیستم عامل آسیب برساندتنها در موارد خاص کاربرد دارد و در صورت دانلود ممکن است پیغامی ظاهر نشود
این دستور خطرناک است و ممکن است به سیستم عامل آسیب برساندبله(Force yes) به حذف دستوراتی که بعنوان پایه در سیستم عامل کاربرد دارند
بله(Force yes) به تمامی پیغامهااین دستور منقرض شده است و با دستورات--allow-downgrades, --allow-remove-essential, --allow-change-held-packagesجایگزین شده است
[--purge]بجای اینکه فایلها نصب شوند آدرس URL آن پرینت میشودهر URL دارای path و destination file name و سایز و کد MD5 استsudo apt-get install aptitude --print-uris [sudo] password for behrooz: Reading package lists. Done Building dependency tree Reading state information. Done The following additional packages will be installed: aptitude-common libclass-accessor-perl libcwidget3v5 libio-string-perl libparse-debianchangelog-perl libsub-name-perl Suggested packages: aptitude-doc-en | aptitude-doc apt-xapian-index debtags libcwidget-dev libhtml-template-perl libxml-simple-perl The following NEW packages will be installed: aptitude aptitude-common libclass-accessor-perl libcwidget3v5 libio-string-perl libparse-debianchangelog-perl libsub-name-perl 0 upgraded, 7 newly installed, 0 to remove and 38 not upgraded. Need to get 3,494 kB of archives. After this operation, 15.8 MB of additional disk space will be used. 'http://deb.debian.org/debian/pool/main/a/aptitude/aptitude-common_0.8.7-1_all.deb' aptitude-common_0.8.7-1_all.deb 1592678 MD5Sum:944f23494615284543660e9ee02c6c6d 'http://deb.debian.org/debian/pool/main/c/cwidget/libcwidget3v5_0.5.17-4+b1_amd64.deb' libcwidget3v5_0.5.17-4+b1_amd64.deb 312582 MD5Sum:153078784a4cac12829bfb967cd9b8c4 'http://deb.debian.org/debian/pool/main/a/aptitude/aptitude_0.8.7-1_amd64.deb' aptitude_0.8.7-1_amd64.deb 1477860 MD5Sum:3bd5df11a809e76d0e925e705b0f9f06 'http://deb.debian.org/debian/pool/main/libs/libsub-name-perl/libsub-name-perl_0.21-1_amd64.deb' libsub-name-perl_0.21-1_amd64.deb 13122 MD5Sum:d2ae0127b9770f1511f9d8d6e65c415a 'http://deb.debian.org/debian/pool/main/libc/libclass-accessor-perl/libclass-accessor-perl_0.34-1_all.deb' libclass-accessor-perl_0.34-1_all.deb 25950 MD5Sum:e8d44fcd57dcb4a39e53f7956b30dd22 'http://deb.debian.org/debian/pool/main/libi/libio-string-perl/libio-string-perl_1.08-3_all.deb' libio-string-perl_1.08-3_all.deb 12298 MD5Sum:8d09424a4c3ba34a8ff890af95391947 'http://deb.debian.org/debian/pool/main/libp/libparse-debianchangelog-perl/libparse-debianchangelog-perl_1.2.0-12_all.deb' libparse-debianchangelog-perl_1.2.0-12_all.deb 59376 MD5Sum:52a19d38904388812afef8d78611e26e
[--reinstall]اگر بجای remove استفاده شود در این صورت همه چیز را پاک خواهد کرد
نصب مجدد بستههای که هماکنون نصب شده است(در ورژن بالاتر)
بطور پیشفرض این سوییچ در دستور تعبیه شده استدرصورت روشن بودن دستور apt بطور اتوماتیک محتوی /var/lib/apt/lists مدیریت را مدیریت کرده و اطمینان حاصل میگردد که فایلهای منسوخ پاک شده باشدتنها دلیلی که این ویژگی را میتوان خاموش کرد این استکه این فایل بطور مداوم تغییر مینمایدنکته: از سوییچ --no-list-cleanup برای خاموش کردن آن استفاده میشود
اگر هر بستهای بخواهد حذف شود دستور apt-get همان موقع بدون اینکه pronpt بدهد قطع میشود
[--only-source]Remove automatically all unused packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed as dependencies changed
تنها در دستورات buil-dep و source معنی پیدا میکند.نشان میدهد که نام سورس داده شده به فایلهای باینری مپ نشده باشد و دستورات تنها نام بستههای سورس را بعنوان آرگومان قبول نمایند
Ignore if packages can't be authenticated and don't prompt about it.This can be useful while working with local repositories, but is a huge security risk if data authenticity isn't ensured in another way by the user itself.The usage of the Trusted option for sources.list(5) entries should usually be preferred over this global override.
[--show-progress]در دستور update ، از گرفتن دیتای verified نشده جلوگیری بعمل میآورددستور apt update در صورت مواجهه با ریپوزیتوریهایی با امضای رمز شده غیر معتبر ، fail میشود
[--with-source filename]نمایش نوار میزان پیشرفت کار در حین نصب با پاک یا آپگرید
Adds the given file as a source for metadata. Can be repeated to add multiple files. See --with-source description in apt-cache(8) for further details.
Specify a configuration file to use.The program will read the default configuration file and then this configuration file.If configuration settings need to be set before the default configuration files are parsed specify a file with the APT_CONFIG environment variable. See apt.conf(5) for syntax information.
Locations to fetch packages from. Configuration Item: Dir::Etc::SourceList.
File fragments for locations to fetch packages from. Configuration Item: Dir::Etc::SourceParts.
APT configuration file. Configuration Item: Dir::Etc::Main.
APT configuration file fragments. Configuration Item: Dir::Etc::Parts.
Version preferences file. This is where you would specify "pinning", i.e. a preference to get certain packages from a separate source or from a different version of a distribution. Configuration Item:[Dir::Etc::Preferences].
File fragments for the version preferences. Configuration Item: Dir::Etc::PreferencesParts.
Storage area for retrieved package files. Configuration Item: Dir::Cache::Archives.
Storage area for package files in transit. Configuration Item: Dir::Cache::Archives (partial will be implicitly appended)
Storage area for state information for each package resource specified in sources.list(5) Configuration Item: Dir::State::Lists.
Storage area for state information in transit. Configuration Item: Dir::State::Lists (partial will be implicitly appended)
list:
[--installed], [--upgradeable], [--all-versions]
list packages based on package names.list is somewhat similar to dpkg-query --list in that it can display a list of packages satisfying certain criteria.
search:
search in package descriptions
show:
show package details and information about the given package(s) including its dependencies, installation and download size, sources the package is available from, the description of the packages content and such more install, remove, purge: Performs the requested action on one or more packages specified via regex(7), glob(7) or exact match. The requested action can be overridden for specific packages by append a plus (+) to the package name to install this package or a minus (-) to remove it.
autoremove:
Remove automatically all unused packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed as dependencies changed
update:
update list of available packages
upgrade:
upgrade the system by installing/upgrading packages
full-upgrade:
upgrade the system by removing/installing/upgrading packages
edit-sources:
edit the source information file (edit your sources.list)
[-f FILE, --file=FILE]
الگوها را از فابل بخواند. هر الگو در یک خط نوشته شود
The empty file contains zero patterns, and therefore matches nothing.
[-i, --ignore-case, -y]
عدم حساسیت به حروف بزرگ و کوچک
Ignore case distinctions in both the PATTERN and the input files.
y سوییچ قدیمی هست و i جدیدتری است
[-v, --invert-match]
الگوی مورد نظر را نشان ندهد
[-x, --line-regexp]Select only those lines containing matches that form whole words.$ grep -w ping #does not match ping”
درصورتی چیزی پیدا کن که (دقیقا) تمام یک خط دقیق الگوی وارد شده باشد
$ grep "hello I am behrooz" sample3:hello I am behrooz sample3:hello I am behrooz! and what is this sample3:hello I am behrooz!, I am fine $ grep -x "hello I am behrooz" sample3:hello I am behrooz
Count the Number of Matches$ grep -c salam *.txt sample1.txt:7 sample2.txt:1 sample3.txt:31 sample4.txt:22
export GREP_COLOR='1;32' #setting green color for pattern
cat file.txt |grep PATTERN --color=auto
فایلهایی که الگو را دارا نمیباشند$ grep -L "how" *.txt #find all files (in the current directory) that do not contain the word "how" file1.txt file25.txt file67.txt
تنها نام فایلهایی که الگو در آن یافت شده است را نشان خواهد داد$ grep -l "how" *.txt #find all files (in the current directory) that do not contain the word "how"
file1.txt
file25.txt
file67.txt
Stop reading a file after NUM matching lines. If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the standard input is positioned to just after the last matching line before exiting, regardless
This enables a calling process to resume a search. When grep stops after NUM matching lines, it outputs any trailing context lines. When the -c or --count option is also used, grep does not output a
When the -v or --invert-match option is also used, grep stops after outputting NUM non-matching lines.
Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.
Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the -s or --no-messages option.
${parameter:=word}:
If parameter is unset or null, the expansion of word is assigned to parameter.
The value of parameter is then substituted.
Positional parameters and special parameters may not be assigned to in this way.
${var:-value}:
if ${var} is set and not null, or value otherwise.
The ${var-value} construct is similar, but checks only that the variable is set.
${var:=value} and ${var=value}:
if var is unset (and also set, but null for the := form).
${var:?message}:
display message to stderr and then exit if var is unset or null.
This should generally not be used within ebuilds as it does not use the die mechanism.
There is a ${var?message} form too.
${var:+value}:
if var is set and not null, or a blank string otherwise.
There is a ${var+value} form.
URL
ps
دستور پی اس بدون سوییچ فقط پروسس های ترمینال کنونی را نمایش خواهد داد
سوییچ l (ال) : توضیحاتی اضافه از پروسس های ترمینال کنونی
پارامترهای F: 1: پردازش در حافظه در حال اجرا است
2: معرف یک systemProcess استفاده
3: پردازش در حافظه lock شده است بخاطر عملیات IO
4: پردازش در وضعیت SWAP است
پارامترهای:S
کاراکتر W: پردازش در حال انتظار است
کاراکتر R: پردازش در حال اجرا
کاراکتر S: پردازش در حال sleep
کاراکتر Z: اجرای پروسس به اتمام رسیده است
کاراکتر T: پروسس متوقف شده است
پارامتر PPID: پردازه پدر این پردازه - چه پروسسی این پردازه را به اجرا در آورده است
ps -el
نمایش تمام پردازه های فعال و درحال اجرا
با قرار دادن nohup باعث میشویم که با logOff هم دستور از بین نرود
!!
execute last command.
!top
execute the most recent command that starts with ‘top’ (e.g. !).
!top:p
displays the command that !top would run (also adds it as the latest command in the command history).
!$
execute the last word of the previous command (same as Alt +., e.g. if last command is ‘cat tecmint.txt’, then !$ would try to run ‘tecmint.txt’).
!$:p
displays the word that !$ would execute.
!*
displays the last word of the previous command.
!*:p
displays the last word that !* would substitute.
tcpdump -i eth0 #Capture Packets from Specific Interface
tcpdump -i any #Capture all packets in any interface
tcpdump -c 5 -i eth0 #Capture Only N Number of Packets
tcpdump -A -i eth0 #Print Captured Packets in ASCII
tcpdump -D #Display Available Interfaces
tcpdump -XX -i eth0 #Display Captured Packets in HEX and
tcpdump -w 0001.pcap -i eth0 #Capture and Save Packets in a File
tcpdump -r 0001.pcap #Read Captured Packets File
tcpdump -n #show IP address replace name (disable name resolution)
tcpdump -nn #show port address replace name (disable port resolution with -nn
tcpdump tcp #Capture only TCP Packets.
tcpdump port 22 #Capture Packet from Specific Port
tcpdump port 80 #capture packets related to a web (HTTP) service
tcpdump -i eth0 src 192.168.0.2 #Capture Packets from source IP
tcpdump -i eth0 dst 50.116.66.139 #Capture Packets from destination IP
tcpdump --number #show acket numbers in output
tcpdump -t #omit timestamp info from tcpdump outpu
tcpdump -v #show detailed output
tcpdump icmp #capture ICMP packets only
tcpdump host 54.204.39.132 #only packets related to a specific host
tcpdump -i any -c5 -nn \
src 192.168.122.98 and port 80 #filter packets from source IP address 192.168.122.98 and service HTTP only
tcpdump -i any -c5 -nn "port 80 \
and (src 192.168.122.98 \
or src 54.204.39.132)" #filtering packets for HTTP service only (port 80) and source IP addresses 192.168.122.98 or 54.204.39.132
URL
[-f FILE, --file=FILE]
الگوها را از فابل بخواند. هر الگو در یک خط نوشته شود
The empty file contains zero patterns, and therefore matches nothing.
[-i, --ignore-case, -y]
عدم حساسیت به حروف بزرگ و کوچک
Ignore case distinctions in both the PATTERN and the input files.
y سوییچ قدیمی هست و i جدیدتری است
[-v, --invert-match]
الگوی مورد نظر را نشان ندهد
[-x, --line-regexp]Select only those lines containing matches that form whole words.$ grep -w ping #does not match ping”
درصورتی چیزی پیدا کن که (دقیقا) تمام یک خط دقیق الگوی وارد شده باشد
$ grep "hello I am behrooz" sample3:hello I am behrooz sample3:hello I am behrooz! and what is this sample3:hello I am behrooz!, I am fine $ grep -x "hello I am behrooz" sample3:hello I am behrooz
Count the Number of Matches$ grep -c salam *.txt sample1.txt:7 sample2.txt:1 sample3.txt:31 sample4.txt:22
export GREP_COLOR='1;32' #setting green color for pattern
cat file.txt |grep PATTERN --color=auto
فایلهایی که الگو را دارا نمیباشند$ grep -L "how" *.txt #find all files (in the current directory) that do not contain the word "how" file1.txt file25.txt file67.txt
تنها نام فایلهایی که الگو در آن یافت شده است را نشان خواهد داد$ grep -l "how" *.txt #find all files (in the current directory) that do not contain the word "how"
file1.txt
file25.txt
file67.txt
توقف بعد از اینکه تعداد مشخص شده پیدا شده باشد
Quiet; do not write anything to standard outputExit immediately with zero status if any match is found, even if an error was detected.
option:
-i This installs a new package(rpm -i package)
-F This will upgrade packages, but only if an earlier version currently exists(rpm -F package)
-U This upgrades or installs the package currently installed to a newer version(rpm -U package)
-e erase (uninstall) package(rpm -e package)
-q query packages(rpm -q package)
-V verify installed packages(rpm -V package)
-K verify package signature(rpm -K package)
--rebuilddb rebuild the database indices from the installed package headers(rpm --rebuilddb)
--initdb create a new database if one doesn’t already exist(rpm --initdb)
--import import PUBKEY(rpm --import /usr/share/rhn/RPM-GPG-KEY)
options with i, U:
-v show package name(rpm -iv package)
-h display progress(rpm -ivh package)
-vv Print lots of ugly debugging information(rpm -ivv package)
--nodeps Don’t do a dependency check before installing or upgrading a package(rpm -ivh --nodeps package)
--test Don’t really uninstall anything, just go through the motions(rpm -ivh --test package)
options with q:
-a Query all installed packages(rpm -qa)
-i Display package information, including name, version, and description. This uses the --queryformat if one was specified(rpm -qi) package
-l List files in package(rpm -ql package)
-c List only configuration files (implies -l)(rpm -qc package)
-d List only documentation files (implies -l)(rpm -qd package)
-f Query package owning FILE(rpm -qf /bin/bash)
-R List packages on which this package depends(rpm -qR package)
-s Display the states of files in the package (implies -l)(rpm -qs package)
--last Orders the package listing by install time such that the latest packages are at the top(rpm -q --last package)
--changelog Display change information for the package(rpm -q --changelog package)
نمایش درصد پیشرفت کار
rpm -i APP.rpm --percent
برای ساخته شدن بانک اطلاعاتی RPM استفاده میشود و اینکه از این دیتابیس برای نگهداری اطلاعات مربوط به بسته های نرم افزاری نصب شده در سیستم عامل استفاده میشود
rpm --rebuilddb
جلوگیری از نصب برخی مستندات از قبیل man pages
rpm -i APP.rpm --excludedocs
نصب مستندات و موارد توضیحی(بصورت پیشفرض در دستور قرار دارد)
rpm -i APP.rpm --included
جایگزین شدن فایلهای نرمافزار جدید برروی نرم افزار قدیمی(نسخههای قدیمی از همان نرمافزار)
rpm -i APP.rpm --replacefiles
جایگزین شدن بستههای نرمافزار جدید برروی نرم افزار قدیمی(نسخههای قدیمی از همان نرمافزار)
rpm -i APP.rpm --replacepkgs
بعد از نصب نرمافزار تعداد 50 کاراکتر (#) روی صفحه نمایش ظاهر شود
rpm -i APP.rpm --hash
بررسی نکردن وابستگیها در حین پاک نمودن یک بسته
rpm -e APP.rpm -nodeps
rpm -e --test -vv APP.rpm
دستور بصورت واقعی صورت نپذیرد و فقط مراحل اجرای دستور در صفحه نمایش نشان داده شود
rpm -ql kernel
فایلهای نصب شده در سیستم عامل از برنامه مورد نظر(بهتر است بجای l از سوییچ s استفاده شود که وضعیت را هم نمایش دهد)
rpm -qs kernel
فایلهایی که در سیستم عامل به نصب بسته مورد نظر ارتباط دارد (اگر فایل خراب شده باشد عبارت missing نمایش داده خواهد شد)-(این سوییچ کمی کاملتر از l [ال]میباشد)
rpm -qd kernel
لیست شدن فایلهای توضیحاتی از بسته مورد نظر
توضیحات کامل از بسته
rpm -qi kernel
rpm -qa kernel
فهرستی از تمام بسته های نصب شده در سیستم عامل
Zones: The firewalld daemon manages groups of rules using entities called zones”
predefined zones:
drop: The lowest level of trust. All incoming connections are dropped without reply and only outgoing connections are possible.
block: Similar to the above, but instead of simply dropping connections, incoming requests are rejected with an icmp-host-prohibited or icmp6-adm-prohibited message.
public: Represents public, untrusted networks. You don’t trust other computers but may allow selected incoming connections on a case-by-case basis.
external: External networks in the event that you are using the firewall as your gateway. It is configured for NAT masquerading so that your internal network remains private but reachable.
internal: The other side of the external zone, used for the internal portion of a gateway. The computers are fairly trustworthy and some additional services are available.
dmz: Used for computers located in a DMZ (isolated computers that will not have access to the rest of your network). Only certain incoming connections are allowed.
work: Used for work machines. Trust most of the computers in the network. A few more services might be allowed.
home: A home environment. It generally implies that you trust most of the other computers and that a few more services will be accepted.
trusted: Trust all of the machines in the network. The most open of the available options and should be used sparingly.
Rule Permanence: In firewalld, rules can be designated as either permanent or immediate. Most firewall-cmd operations can take the "--permanent" flag
Install and Enable Your Firewall to Start at Boot
$ sudoyum install firewalld Install $ sudo systemctl enable firewalld $ sudo reboot
verify the service is running and reachable by typing:
$ sudo firewall-cmd --state output: running
Current Firewall Rules( which zone is currently selected as the default)
firewall-cmd --get-default-zone output: publicPrint currently active zones
Print currently active zones
firewall-cmd --get-active-zones output: privateDNS interfaces: eth1 publicweb interfaces: eth0
list of the available zone
$ sudo firewall-cmd --get-zones output: block dmz drop external home internal public trusted work
see the specific configuration associated with a zone
$ sudo firewall-cmd --zone=home --list-all output : home interfaces: sources: services: dhcpv6-client ipp-client mdns samba-client ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules:
see the specific configuration associated with all zone
sudo firewall-cmd --list-all-zones
list of the available services
firewall-cmd --get-services output RH-Satellite-6 amanda-client amanda-k5-client bacula bacula-client bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc ceph ceph-mon cfengine condor-collector ctdb dhcp dhcpv6 dhcpv6-client dns docker-registry dropbox-lansync elasticsearch freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trust ftp ganglia-client ganglia-master high-availability http https imap imaps ipp ipp-client ipsec iscsi-target kadmin kerberos kibana klogin kpasswd kshell ldap ldaps libvirt libvirt-tls managesieve mdns mosh mountd ms-wbt mssql mysql nfs nrpe ntp open ovirt-imageio ovirt-storageconsole ovirt-vmconsole pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy proxy-dhcp ptp pulseaudio puppetmaster quassel radius rpc-bind rsh rsyncd samba samba-client sane sip sips smtp smtp-submission smtps snmp snmptrap spideroak-lansync squid ssh synergy syslog syslog-tls telnet tftp tftp-client tinc tor-socks transmission-client vdsm vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local xmpp-server
list services
sudo firewall-cmd --zone=public --list-all sudo firewall-cmd --zone=public --list-services
List of ports
sudo firewall-cmd --zone=public --list-ports
Changing the Zone of an Interface
sudo firewall-cmd --zone=home --change-interface=eth0 output success
Adjusting the Default Zone
sudo firewall-cmd --set-default-zone=home
allow http/https traffic in our public” zone
sudo firewall-cmd --zone=public --add-service=http sudo firewall-cmd --zone=public --add-service=http --permanent sudo firewall-cmd --zone=public --add-service=https sudo firewall-cmd --zone=public --permanent --add-service=https
Opening a Port for your Zones
sudo firewall-cmd --zone=public --add-port=5000/tcp sudo firewall-cmd --zone=public --add-port=4990-4999/udp sudo firewall-cmd --zone=public --permanent --add-port=5000/tcp sudo firewall-cmd --zone=public --permanent --add-port=4990-4999/udp sudo firewall-cmd --zone=public --permanent --list-ports
change interface over zones
sudo firewall-cmd --zone=public --change-interface=eth0
در آموزش زیر :
آدرس شبکه :10.0.20.0/24
نام دامنه: MyDomain.it
سرور دی ان اس: 10.0.20.240
سرورد دی ان اس برای فوروارد:192.168.100.12
options { directory "/var/cache/bind"; listen-on port 53 {localhost;10.0.20.0/24;192.168.40.0/24; }; allow-query {localhost;10.0.20.0/24;192.168.40.0/24;}; recursion yes; forwarders { 192.168.100.12; 8.8.8.8; }; dnssec-validation auto; auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; };
zone "MyDomain.it" IN { type master; file "MyDomain.it"; };
$TTL 86400 @ IN SOA ns1.MyDomain.it. root.MyDomain.it( 20191214 ;Serial 3600 ;Refresh 900 ;Retry 604800 ;Expired 86400 ;Minimum TTL ) ;name servers: NS records IN NS ns1.MyDomain.it. IN A 192.168.40.40 IN MX 10 mail.MyDomain.it. ;name servers: A records ns1.MyDomain.it. IN A 192.168.40.40 dns.MyDomain.it. IN A 192.168.40.40 root.MyDomain.it. IN A 192.168.40.40 MyDomain.it. IN A 192.168.40.40 chat.MyDomain.it. IN A 192.168.40.41 mail.MyDomain.it. IN A 192.168.40.42 email.MyDomain.it. IN A 192.168.40.42 pop3.MyDomain.it. IN A 192.168.40.42 smtp.MyDomain.it. IN A 192.168.40.42 imap.MyDomain.it. IN A 192.168.40.42 behrooz.MyDomain.it. IN A 192.168.40.48
# rndc querylog on
$ sudo named-checkconf
# /usr/sbin/named-checkzone my.net /var/cache/bind/my.net.zone
$ sudo systemctl enable bind9 $ sudo systemctl start bind9
upgrade:گرفتن (دوباره بدست آوردن) لیست بستههای جدید
آپگرید کردن
remove:نصب یک بسته
حذف یک بسته
حذف بسته به همراه تمامی تنظیمات آن
Remove automatically all unused packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.
Distribution upgrade
Configure build-dependencies for source packages. install all dependencies for 'packagename'
Erase downloaded archive files. clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
پاک کردن فایلهای آرشیو شده از دانلودهای قبلی
Verify that there are no broken dependencies
Download source archives. Source packages are tracked separately from binary packages via deb-src lines in the sources.list.[--compile]: package will be compiled to a binary .deb using dpkg-buildpackage for the architecture as defined by the [--host-architecture] option.[--download-only]:source package will not be unpacked.
دانلود فایل باینری در مسیر فعلی
Download and display the changelog for the given packageسیاهه یا تاریخچهٔ تغییراتی که در پروژه صورت گرفته است
listing of information about all data files (index targets) apt-get update would download
در هنگام نصب، بستههای توصیهشده بعنوان وابستگی لحاظ نشوند
درهنگام نصب بستههای پیشنهاد شونده(توسط برنامه) بعنوان وابستگی لحاظ نشوند
فقط فایلها دانلود شوند(unpacked یا نصب نشوند)
تلاش برای اصلاح گسیختگیهای موجود در وابستگیهابا این گزینه به برنامه apt اجازه داده میشود تا درصورت نیاز هر بستهای را حذف نماید
نادیده گرفتن بستههای خرابی(مثلا دانلود نمیشوند یا اینکه دانلود شده اند ولی خراب هستند)اگر بستهها نمیتوانند دانلود شوند یا بعد از دانلود امکان چک و بررسی یکپارچکی وجود نداردآن بستهها را عقب نگهدار و نتیجه را هندل کناگر این سوییچ را با -f استفاده نمایید ممکن است در مواردی به ارور برخورد نماییداگر نام یک بسته در خط فرمان برای نصب آورده شده باشد درصورت عدم دانلود این بسته بدون هیچ گونه اخطاری از نصب این بسته صرف نظر میشود
فقط از بستههای deb موجود(کنونی) در سیستمعامل که پیشتر دانلود شده استفاده شود
این کامند برای تهیه لاگ بسیار مفید است زیرا نشانگرهای پیشرفت و موارد توضیحاتی را حذف میکندبا مقداردهی به -q=# میتوانیم سطح عدم تولید توضیحات را مشخص نماییم
هیچ کاری صورت نگیردشبیهسازی و نمایش در خروجی از تغییراتی که با اجرای دستور صورت خواهد گرفت
بطور اتوماتیک به هر prompt پاسخ yes خواهد دادrun non-interactivelyدر موارد نامطلوب دستور apt-get متوقف خواهد شد(نظیر: تغییر در نگهداری بسته یا نصب یک بسته غیرمجاز یا حذف یک بسته خیلی مهم)
بصورت پیشفرض به همه promp ها پاسخ no میدهد
[-V, --verbose-versions]عدم نمایش لیست تمام بستههایی که آپگرید شدهاند
[-a, --host-architecture]نمایش نسخه تمام نسخهها از بستههایی که آپگرید شدهاند
بصورت پیشفرض تنظیم نیستدر زمان استفاده از دستور apt-get source --compile معماری بستههای build شونده کنترل و cross-builddependencies تامین شوند
Compile source packages after downloading them.
Ignore package holds;بسته را نگهداری ننماید-به عبارتی پس از نصب آن را در سیستم نگهندارد
این سوییچ وقتی با دستور upgrade همراه شود دراین صورت مجاز به نصب بستههای جدید خواهد بود.این دستور زمان نیازمندی به یک dependency مفید خواهد بود تا آن نیز بتواند نصب نمایدنکته:دستور upgrade هیچگاه بستهای را حذف نمیکند و فقط بسته جدید را نصب میکند
Do not upgrade packages;همراه با دستور install : اگر بسته هماکنون نصب شده باشد آنگاه از upgrade آن دستور جلوگیری بعمل خواهد آمد
همراه با دستور install : اگر بسته هماکنون در سیستمعامل موجود نباشد، نصب صورت نگیرد
تنها زمانی بسته را آپگرید خواهد کرد که درحال حاضر بسته در سیستمعامل وجود داشته و ورژن جدید از آن در دسترس باشد
[--allow-remove-essential]این دستور خطرناک است و ممکن است به سیستم عامل آسیب برساندتنها در موارد خاص کاربرد دارد و در صورت دانلود ممکن است پیغامی ظاهر نشود
این دستور خطرناک است و ممکن است به سیستم عامل آسیب برساندبله(Force yes) به حذف دستوراتی که بعنوان پایه در سیستم عامل کاربرد دارند
بله(Force yes) به تمامی پیغامهااین دستور منقرض شده است و با دستورات--allow-downgrades, --allow-remove-essential, --allow-change-held-packagesجایگزین شده است
[--purge]بجای اینکه فایلها نصب شوند آدرس URL آن پرینت میشودهر URL دارای path و destination file name و سایز و کد MD5 استsudo apt-get install aptitude --print-uris [sudo] password for behrooz: Reading package lists. Done Building dependency tree Reading state information. Done The following additional packages will be installed: aptitude-common libclass-accessor-perl libcwidget3v5 libio-string-perl libparse-debianchangelog-perl libsub-name-perl Suggested packages: aptitude-doc-en | aptitude-doc apt-xapian-index debtags libcwidget-dev libhtml-template-perl libxml-simple-perl The following NEW packages will be installed: aptitude aptitude-common libclass-accessor-perl libcwidget3v5 libio-string-perl libparse-debianchangelog-perl libsub-name-perl 0 upgraded, 7 newly installed, 0 to remove and 38 not upgraded. Need to get 3,494 kB of archives. After this operation, 15.8 MB of additional disk space will be used. 'http://deb.debian.org/debian/pool/main/a/aptitude/aptitude-common_0.8.7-1_all.deb' aptitude-common_0.8.7-1_all.deb 1592678 MD5Sum:944f23494615284543660e9ee02c6c6d 'http://deb.debian.org/debian/pool/main/c/cwidget/libcwidget3v5_0.5.17-4+b1_amd64.deb' libcwidget3v5_0.5.17-4+b1_amd64.deb 312582 MD5Sum:153078784a4cac12829bfb967cd9b8c4 'http://deb.debian.org/debian/pool/main/a/aptitude/aptitude_0.8.7-1_amd64.deb' aptitude_0.8.7-1_amd64.deb 1477860 MD5Sum:3bd5df11a809e76d0e925e705b0f9f06 'http://deb.debian.org/debian/pool/main/libs/libsub-name-perl/libsub-name-perl_0.21-1_amd64.deb' libsub-name-perl_0.21-1_amd64.deb 13122 MD5Sum:d2ae0127b9770f1511f9d8d6e65c415a 'http://deb.debian.org/debian/pool/main/libc/libclass-accessor-perl/libclass-accessor-perl_0.34-1_all.deb' libclass-accessor-perl_0.34-1_all.deb 25950 MD5Sum:e8d44fcd57dcb4a39e53f7956b30dd22 'http://deb.debian.org/debian/pool/main/libi/libio-string-perl/libio-string-perl_1.08-3_all.deb' libio-string-perl_1.08-3_all.deb 12298 MD5Sum:8d09424a4c3ba34a8ff890af95391947 'http://deb.debian.org/debian/pool/main/libp/libparse-debianchangelog-perl/libparse-debianchangelog-perl_1.2.0-12_all.deb' libparse-debianchangelog-perl_1.2.0-12_all.deb 59376 MD5Sum:52a19d38904388812afef8d78611e26e
[--reinstall]اگر بجای remove استفاده شود در این صورت همه چیز را پاک خواهد کرد
نصب مجدد بستههای که هماکنون نصب شده است(در ورژن بالاتر)
بطور پیشفرض این سوییچ در دستور تعبیه شده استدرصورت روشن بودن دستور apt بطور اتوماتیک محتوی /var/lib/apt/lists مدیریت را مدیریت کرده و اطمینان حاصل میگردد که فایلهای منسوخ پاک شده باشدتنها دلیلی که این ویژگی را میتوان خاموش کرد این استکه این فایل بطور مداوم تغییر مینمایدنکته: از سوییچ --no-list-cleanup برای خاموش کردن آن استفاده میشود
اگر هر بستهای بخواهد حذف شود دستور apt-get همان موقع بدون اینکه pronpt بدهد قطع میشود
[--only-source]Remove automatically all unused packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed as dependencies changed
تنها در دستورات buil-dep و source معنی پیدا میکند.نشان میدهد که نام سورس داده شده به فایلهای باینری مپ نشده باشد و دستورات تنها نام بستههای سورس را بعنوان آرگومان قبول نمایند
Ignore if packages can't be authenticated and don't prompt about it.This can be useful while working with local repositories, but is a huge security risk if data authenticity isn't ensured in another way by the user itself.The usage of the Trusted option for sources.list(5) entries should usually be preferred over this global override.
[--show-progress]در دستور update ، از گرفتن دیتای verified نشده جلوگیری بعمل میآورددستور apt update در صورت مواجهه با ریپوزیتوریهایی با امضای رمز شده غیر معتبر ، fail میشود
[--with-source filename]نمایش نوار میزان پیشرفت کار در حین نصب با پاک یا آپگرید
Adds the given file as a source for metadata. Can be repeated to add multiple files. See --with-source description in apt-cache(8) for further details.
Specify a configuration file to use.The program will read the default configuration file and then this configuration file.If configuration settings need to be set before the default configuration files are parsed specify a file with the APT_CONFIG environment variable. See apt.conf(5) for syntax information.
Locations to fetch packages from. Configuration Item: Dir::Etc::SourceList.
File fragments for locations to fetch packages from. Configuration Item: Dir::Etc::SourceParts.
APT configuration file. Configuration Item: Dir::Etc::Main.
APT configuration file fragments. Configuration Item: Dir::Etc::Parts.
Version preferences file. This is where you would specify "pinning", i.e. a preference to get certain packages from a separate source or from a different version of a distribution. Configuration Item:[Dir::Etc::Preferences].
File fragments for the version preferences. Configuration Item: Dir::Etc::PreferencesParts.
Storage area for retrieved package files. Configuration Item: Dir::Cache::Archives.
Storage area for package files in transit. Configuration Item: Dir::Cache::Archives (partial will be implicitly appended)
Storage area for state information for each package resource specified in sources.list(5) Configuration Item: Dir::State::Lists.
Storage area for state information in transit. Configuration Item: Dir::State::Lists (partial will be implicitly appended)
apt-get -y install --print-uris <PackageName> | cut -f 2 -d \' | grep \.deb
systemd-resolve -t MX gmail.com #show mail server
systemd-resolve -t SOA gmail.com #show SOA . Start Of Authority (More administrative information) URL
systemd-resolve 85.214.157.7 #Get domain name
nslookup domain.ir [#Finding The IP Address of an Host from default dns server]
nslookup domain.ir 8.8.8.8[#Finding The IP Address of an Host From non default dns server]
nslookup -querytype=mx domain.ir[ #Find Mail Servers for a Domain]
nslookup -query=mx domain.ir [#Find Mail Servers]
nslookup -query=ns domain.ir [ #Find NameServers]
nslookup -query=soa domain.ir [ #display the SOA record (information about the domain]
nslookup -query=any domain.ir [ #display all the available DNS records]
host -la domain.com [Show all record with Information]
dig Domain.it axfr [Show all record with Information]
systemd-resolve --statistics #informations
sudo systemd-resolve --flush-caches
sudo systemd-resolve --statistics
sudo /etc/init.d/dns-clean start
systemd-resolve -t MX gmail.com #show mail server
systemd-resolve -t SOA gmail.com #show SOA . Start Of Authority (More administrative information) URL
systemd-resolve 85.214.157.7 #Get domain name
nslookup domain.ir [#Finding The IP Address of an Host from default dns server]
nslookup domain.ir 8.8.8.8[#Finding The IP Address of an Host From non default dns server]
nslookup -querytype=mx domain.ir[ #Find Mail Servers for a Domain]
nslookup -query=mx domain.ir [#Find Mail Servers]
nslookup -query=ns domain.ir [ #Find NameServers]
nslookup -query=soa domain.ir [ #display the SOA record (information about the domain]
nslookup -query=any domain.ir [ #display all the available DNS records]
host -la domain.com [Show all record with Information]
dig Domain.it axfr [Show all record with Information]
systemd-resolve --statistics #informations
sudo systemd-resolve --flush-caches
sudo systemd-resolve --statistics
sudo /etc/init.d/dns-clean start
Install:
sudo apt install resolvconf
For fix and NotChange file:
vim /etc/NetworkManager/NetworkManager.conf
#Add below to main area :
dns=none
# cat /proc/scsi/scsi | egrep -i 'Host:' | wc -l 7
$ echo "- - -" > /sys/class/scsi_host/host0/scan #("- - -") of the command act as wildcards meaning rescan everything
$ echo "c t l" > /sys/class/scsi_host/hosth/scan # h is the HBA number # c is the channel on the HBA # t is the SCSI target ID # l is the LUN.
#If you don't have the host bus number, you must list all the existing host bus number on your system with the command
$ ls /sys/class/scsi_host host0 host1 host2 $ echo "- - -" > /sys/class/scsi_host/host0/scan $ echo "- - -" > /sys/class/scsi_host/host1/scan $ echo "- - -" > /sys/class/scsi_host/host2/scan <OR> # for host in `ls /sys/class/scsi_host/`;do echo "- - -" >/sys/class/scsi_host/${host}/scan; done
محیط استیج یعنی وضعیت آماده کامیت کردن
$ git init
$ git status
$ git add <File>
$ git add -A
$ git commit -m "message"
$ git log --stat --summary
$ 111git log -p
$ 111git diff HEAD
$ git diff --staged $ git diff --color
$ git reset file
$ git checkout -- <FILE>
$ git branch
$ git branch <Name>
$ git checkout <branchName>
$ git merge <branchName>
$ git rm <file>
$ git branch -d <BranchName>
$ git clone <URL.git>
$ git push origin master
$ git pull origin master
$ git remote
$ git remote add origin URL
$ git push origin master
$ git show <Hash Of Commit>
$ git shwo <tag name>
$ git tag
$ git tag -a v2.0.1 -m " توضیحات در باره این تگ"
$ git tag -a v1.3.9 <Hash Of custom commit> -m "توضیحات درباره تک"
$ git tag -l "v*"
$ git push origin <TagName>
$ git push origin --tags
$ git checkout <Tag name>
$ git config --global user.name
$ git blame <FileName>
$ git blame <FileName> -L8
$ git blame <FileName> -L8,10
$ git config --global user.name "Your Full Name" $ git config --global user.email you@somewhere.com
$ git checkout -- filename
$ git reset HEAD filename
اگر جندین کارت شبکه را به جهت افزایش troughtPut و bandwidth به هم پیوند بدهیم و در نتیجه خروجی حاصله برابر جمع پهنای باندها(هریک به تنهایی) بشود در این صورت از تکنیک bond استفاده شده است:
modprobe bonding ifconfig eth0 down ifconfig eth1 down ifconfig bond0 up ifenslave bond0 eth0 eth1 ifconfig bond0 192.168.0.1 netmask 255.255.255.0 ifconfig eth0 up ifconfig eth1 up ---------------------------------------- # ip link add bond0 type bond # ip link set bond0 type bond miimon 100 mode active-backup # ip link set em1 down # ip link set em1 master bond0 # ip link set em2 down # ip link set em2 master bond0 # ip link set bond0 up
ماژول pam_access.so در لینوکس وجود دارد ولی به کرنل اضافه نشده است و باید برای ایجاد محدودیت آن را به کرنل اضافه نماییم
برای اینکار:
$ vim /etc/security/access.conf: #add role: + : root : ALL $ vi /etc/pam.d/password-auth account <tab> required <tab> pam-access.so
نکته: میتوان از syntax فایل login موجود در مسیر pam.d موجود در مسیر etc استفاده کرد
محیط استیج یعنی وضعیت آماده کامیت کردن
$ git init
$ git status
$ git add <File>
$ git add -A
$ git commit -m "message"
$ git log --stat --summary
$ 111git log -p
$ 111git diff HEAD
$ git diff --staged $ git diff --color
$ git reset file
$ git checkout -- <FILE>
$ git branch
$ git branch <Name>
$ git checkout <branchName>
$ git fetch origin
$ git merge origin/master
$ git merge <branchName>
$ git rm <file>
$ git rm --cached <FileNames>
$ git rm --cached -r <FOLDER>
$ git branch -d <BranchName>
$ git clone <URL.git>
$ git push origin master
$ git pull origin master
$ git remote
$ git remote add origin URL
$ git push origin master
$ git show <Hash Of Commit>
$ git shwo <tag name>
$ git tag
$ git tag -a v2.0.1 -m " توضیحات در باره این تگ"
$ git tag -a v1.3.9 <Hash Of custom commit> -m "توضیحات درباره تک"
$ git tag -l "v*"
$ git push origin <TagName>
$ git push origin --tags
$ git checkout <Tag name>
$ git config --global user.name
$ git blame <FileName>
$ git blame <FileName> -L8
$ git blame <FileName> -L8,10
$ git config --global user.name "Your Full Name" $ git config --global user.email you@somewhere.com
$ git checkout -- filename
$ git reset HEAD filename
درباره این سایت