In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
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
Install Python 3.7.5 on CentOS/RHEL 7 | |
1.Requirements: | |
yum install gcc openssl-devel bzip2-devel libffi-devel | |
# Below requirement for djang projects | |
yum install readline-devel tk-devel tk-devel openssl-devel sqlite-devel openssl tk readline sqlite | |
2.Download Python 3.7: |
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
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class | |
# C extensions | |
*.so | |
# Distribution / packaging |
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
More recent resolution: | |
1. cd ~/../../etc (go to etc folder in WSL). | |
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line). | |
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line). | |
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian). | |
5. cd ~/../../etc (go to etc folder in WSL). | |
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file). | |
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and | |
secondary. |
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 get_surname_code(surname: str, fill_string='0') -> str: | |
seperators, i, pos = ("'", " ", "-"), 0, 0 | |
for letter in surname: | |
i += 1 | |
if letter in seperators: | |
pos = i | |
return surname[pos:pos+3].upper().ljust(3,fill_string) | |
# Example: |
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
#!/usr/bin/env bash | |
########################################################################### | |
##### $Author Mike Houngbadji (mike.kenneth47@gmail.com) | |
# $Description: data Real time Pipeline in kafka | |
# $History | |
# 20161009 @MIKE | |
########################################################################### | |
kafka_producer='$KAFKA_HOME/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test'; |
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
import pandas as pd | |
import pandera as pa | |
def clean_dataframe_with_schema(dataframe, schema): | |
try: | |
return schema.validate(dataframe) | |
except (pa.errors.SchemaErrors, pa.errors.SchemaError) as err: | |
return dataframe.drop(labels=err.failure_cases['index'].to_list()) |
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
# Code pour calculer les rangs | |
def rank_scores(scores:list): | |
return {moyenne: rang for rang, moyenne in enumerate(reversed(sorted(set(moyennes))), start=1)} | |
moyennes = [1, 2, 20 , 16, 19, 18, 0, 6, 6.5, 12.5, 0.5, 15.60, 17.8] | |
ranked_scores = rank_scores(moyennes) | |
# Ensuites on peut recupere les range en entrant la moyennes comme input | |
ranked_scores.get(2) # 10 |
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
DROP TABLE if exists d_date; | |
CREATE TABLE d_date | |
( | |
date_dim_id INT NOT NULL, | |
date_actual DATE NOT NULL, | |
epoch BIGINT NOT NULL, | |
day_suffix VARCHAR(4) NOT NULL, | |
day_name VARCHAR(9) NOT NULL, | |
day_of_week INT NOT NULL, |
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
import serial | |
import time | |
# Instantiate serial connection to the HD Ranger | |
hd_ranger_serial_port_id = '/dev/ttyUSB0' # 'COM5' | |
ser = serial.Serial(hd_ranger_serial_port_id, 115200) # open serial port | |
print(ser.name) # check which port was really used | |
# Get XON from HD Ranger | |
print(ser.read(1)) # Pour lire le XON |
OlderNewer