View cuda_reset.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to find and kill gnome and xorg processes using the NVIDIA GPU | |
kill_gpu_processes() { | |
# Find Gnome and Xorg processes using the NVIDIA GPU | |
local gpu_processes=$(nvidia-smi | grep 'gnome\|xorg' | awk '{ print $5 }') | |
# Kill the processes gracefully | |
for pid in $gpu_processes; do | |
echo "Killing process with PID $pid" | |
kill $pid |
View CUDA 11.8 on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
View it.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def it(n) | |
x = [*2..n] | |
x.each do |i| | |
[*(i+1)..n].each { |j| x.delete(j) if (j%i).zero? } | |
end | |
end | |
# 1) what does it do? | |
# 2) how fast is it? | |
# 3) can you make it faster? |
View colors.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="white">#FFFFFF</color> | |
<color name="ivory">#FFFFF0</color> | |
<color name="light_yellow">#FFFFE0</color> | |
<color name="yellow">#FFFF00</color> | |
<color name="snow">#FFFAFA</color> | |
<color name="floral_white">#FFFAF0</color> | |
<color name="lemon_chiffon">#FFFACD</color> | |
<color name="cornsilk">#FFF8DC</color> |