How to manually install Nvidia Driver and cuda in ubuntu linux

How to manually install Nvidia Driver and cuda in ubuntu linux

Go to nvidia website and download driver, for this tutorial i am using .run file copy the file to your desktop , after that simply right click and select properties > select permissions > tick Execute : allow executing file as program ,

click this link to learn how to make file executable using terminal

after that you need to black list nouveau for that type following command in the terminal

 

sudo nano /etc/modprobe.d/blacklist-nouveau.conf

then copy following text in the nano editor in terminal then save it

blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off

then type following command in the terminal

sudo update-initramfs -u

reboot your system after this procedure , now you can find your system resolution is changed from recommended to minimal,once login screen appear press Ctrl + Alt +F1 this will switch your interface from GUI to CLI then login by typing your username and password after that you should stop your Desktop Manager, by default ubuntu using lightdm you type following command in the terminal to stop lightdm

sudo service lightdm stop

this will stop gui service running in background then you should navigate to your nvidia driver location by typing cd /Destkop

if you type ls you can find driver which you have copied earlier

after that you need to execute driver installation file for that type following command in the terminal

sudo ./NVIDIA-Linux-x86_64-375.66.run

Please note the driver version which you are using may vary

then follow the instructions !

after installation reboot your system

in my system i have two cards one is Nvidia quadro K2200 & Tesla k40c

so i am going to install cuda to install cuda type follwing command line in the terminal , offline installation is also available i will include that tutorial in the future blog post if you want to download offline cuda package you can download it from https://developer.nvidia.com/cuda-downloads

sudo apt-get install nvidia-cuda-toolkit

this package is around 750 mb , installation speed is depend on your internet connecton, after installation reboot your system, to confirm whether both graphics card is detected in your system you can use inxi utility for that install inxi package in your system by typing

sudo apt-get install inxi

after the installation , open terminal and type

 

inxi -G

congratulations you have successfully install both nvidia driver and cuda

How to make file executable using terminal

How to make file executable using terminal

To give permission to execute a file you should navigate to file copied location in terminal

by default when you open-up the terminal your terminal location will look some thing like this

george@Area51-HP-Pro-3330-MT ~ $

if you type “pwd

you can see current directory in the terminal

george@Area51-HP-Pro-3330-MT ~ $ pwd

/home/george                                         <—-  currently i have mounted to /home/user

for this tutorial i have copied file in a folder in the desktop so i have to navigate to that directory for eg: my folder name is called “Dashboard”

to navigate that folder i have to type in cd /Desktop/Dashboard

after that type ls so that you can list all files in the terminal

they type following command in the terminal , in my case i am using NVIDIA-Linux-x86_64-375.66.run file as executable this may vary with yours

sudo chmod +x ./NVIDIA-Linux-x86_64-375.66.run

* Note

sudo = root “super user ” permission

 

chmod = The command name chmod stands for “change mode”, and it is used to define the way a file can be accessed.

 

+x = this will execute a file

 

./ = if you are using a script .sh or .run you should use this following by the file name

 

if you use -x instead of +x this will remove file permission

 

sudo chmod -x ./NVIDIA-Linux-x86_64-375.66.run

This is will remove permissions

How to configure raid in HP Z840 workstation

How to configure raid in HP Z840 workstation

Power on your workstation and press Ctrl + C in the post screen

now you can find LSI config utility is initializing

with in the utility you can find the LSISAS2308 adapter

select it

in the next screen select raid properties

in the next screen you can find available raids , in our case we have used 512 mb x 3 ssd’s

in the current configuration of this workstation available raid is Raid 1 , Raid 1E , and 10 , and Raid 0

i have selected Raid 1E

in the next menu you have to select raid disks from no to yes and Press “ C “ create raid

in the next menu select “Save changes then exit this menu “

done

DDOS

DDOS

 

A Distributed Denial-of-Service (DDoS) attack is an attack in which multiple compromised computer systems attack a target, such as a server, website or other network resource, and cause a denial of service for users of the targeted resource. The flood of incoming messages, connection requests or malformed packets to the target system forces it to slow down or even crash and shut down, thereby denying service to legitimate users or systems.

 

How DDoS Attacks Work

In a DDoS attack, the incoming traffic flooding the victim originates from many different sources – potentially hundreds of thousands or more. This effectively makes it impossible to stop the attack simply by blocking a single IP address; plus, it is very difficult to distinguish legitimate user traffic from attack traffic when spread across so many points of origin.

 

Types of DDoS Attacks

There are many types of DDoS attacks. Common attacks include the following:

Traffic attacks: Traffic flooding attacks send a huge volume of  TCP, UDP and ICPM packets to the target. Legitimate requests get lost and these attacks may be accompanied by malware exploitation.

Bandwidth attacks: This DDos attack overloads the target with massive amounts of junk data. This results in a loss of network bandwidth and equipment resources and can lead to a complete denial of service.

Application attacks: Application-layer data messages can deplete resources in the application layer, leaving the target’s system services unavailable.

 

For Linux Servers

1. Find to which IP address in the server is targeted by the DDoS attack

#netstat -plan | grep :80 | awk ‘{print $4}’ | cut -d: -f1 |sort |uniq -c

 

2. To find from which IPs, the attack is coming

#netstat -plan | grep :80 | awk ‘{print $5}’ | cut -d: -f1 |sort |uniq -c

 

 

3. For securing the server against DDoS/Drop Sync Attack

 

In /etc/sysctl.conf

Paste the following into the file, you can overwrite the current information.

#Kernel sysctl configuration file for Red Hat Linux

# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and

# sysctl.conf(5) for more details.

 

# Disables packet forwarding

net.ipv4.ip_forward=0

 

# Disables IP source routing

net.ipv4.conf.all.accept_source_route = 0

net.ipv4.conf.lo.accept_source_route = 0

net.ipv4.conf.eth0.accept_source_route = 0

net.ipv4.conf.default.accept_source_route = 0

 

# Enable IP spoofing protection, turn on source route verification

net.ipv4.conf.all.rp_filter = 1

net.ipv4.conf.lo.rp_filter = 1

net.ipv4.conf.eth0.rp_filter = 1

net.ipv4.conf.default.rp_filter = 1

 

# Disable ICMP Redirect Acceptance

net.ipv4.conf.all.accept_redirects = 0

net.ipv4.conf.lo.accept_redirects = 0

net.ipv4.conf.eth0.accept_redirects = 0

net.ipv4.conf.default.accept_redirects = 0

 

# Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets

net.ipv4.conf.all.log_martians = 0

net.ipv4.conf.lo.log_martians = 0

net.ipv4.conf.eth0.log_martians = 0

 

# Disables IP source routing

net.ipv4.conf.all.accept_source_route = 0

net.ipv4.conf.lo.accept_source_route = 0

net.ipv4.conf.eth0.accept_source_route = 0

net.ipv4.conf.default.accept_source_route = 0

 

# Enable IP spoofing protection, turn on source route verification

net.ipv4.conf.all.rp_filter = 1

net.ipv4.conf.lo.rp_filter = 1

net.ipv4.conf.eth0.rp_filter = 1

net.ipv4.conf.default.rp_filter = 1

 

# Disable ICMP Redirect Acceptance

net.ipv4.conf.all.accept_redirects = 0

net.ipv4.conf.lo.accept_redirects = 0

net.ipv4.conf.eth0.accept_redirects = 0

net.ipv4.conf.default.accept_redirects = 0

 

# Disables the magic-sysrq key

kernel.sysrq = 0

 

# Decrease the time default value for tcp_fin_timeout connection

net.ipv4.tcp_fin_timeout = 15

 

# Decrease the time default value for tcp_keepalive_time connection

net.ipv4.tcp_keepalive_time = 1800

 

# Turn off the tcp_window_scaling

net.ipv4.tcp_window_scaling = 0

 

# Turn off the tcp_sack

net.ipv4.tcp_sack = 0

 

# Turn off the tcp_timestamps

net.ipv4.tcp_timestamps = 0

 

# Enable TCP SYN Cookie Protection

net.ipv4.tcp_syncookies = 1

 

# Enable ignoring broadcasts request

net.ipv4.icmp_echo_ignore_broadcasts = 1

 

# Enable bad error message Protection

net.ipv4.icmp_ignore_bogus_error_responses = 1

 

# Log Spoofed Packets, Source Routed Packets, Redirect Packets

net.ipv4.conf.all.log_martians = 1

 

# Increases the size of the socket queue (effectively, q0).

net.ipv4.tcp_max_syn_backlog = 1024

 

# Increase the tcp-time-wait buckets pool size

net.ipv4.tcp_max_tw_buckets = 1440000

 

# Allowed local port range

net.ipv4.ip_local_port_range = 16384 65536

 

Run /sbin/sysctl -p and sysctl -w net.ipv4.route.flush=1 to enable the changes without a reboot.

 

TCP Syncookies

echo 1 > /proc/sys/net/ipv4/tcp_syncookies

 

Some IPTABLES Rules:

iptables -A INPUT -p tcp –syn -m limit –limit 1/s –limit-burst 3 -j RETURN

iptables -A INPUT -p tcp –syn -m state –state ESTABLISHED,RELATED –dport 80 -m limit –limit 1/s –limit-burst 2 -j ACCEPT

Pin It on Pinterest