A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
#!/usr/bin/env bash | |
# ------------------------------------------------------------------ | |
# Script Name: filecp.sh | |
# Description: A Bash Script to Copy Files | |
# Website: https://gist.github.com/ostechnix | |
# Version: 1.0 | |
# Usage: sudo ./filecp.sh | |
# ------------------------------------------------------------------ |
#!/usr/bin/env bash | |
# ------------------------------------------------------------------ | |
# Script Name: deloldfile.sh | |
# Description: Remove all Log Files older than 30 days | |
# Website: https://gist.github.com/ostechnix | |
# Version: 1.0 | |
# Usage: sudo ./deloldfile.sh | |
# ------------------------------------------------------------------ |
#!/usr/bin/env bash | |
# ------------------------------------------------------------------ | |
# Script Name: debupdate.sh | |
# Description: An Interactive Bash Shell Script to | |
# Update a Debian-based System | |
# Website: https://gist.github.com/ostechnix | |
# Version: 1.0 | |
# Usage: sudo ./debupdate.sh | |
# ------------------------------------------------------------------ |
#!/usr/bin/env bash | |
# ------------------------------------------------------------------ | |
# Script Name: enablebackports.sh | |
# Description: A Bash Script to check and enable Backports | |
# repository in Debian Linux. | |
# Website: https://gist.github.com/ostechnix | |
# Version: 1.0 | |
# Usage: sudo ./enablebackports.sh | |
# ------------------------------------------------------------------ |
#!/usr/bin/env python | |
# ------------------------------------------------------------------ | |
# Script Name: showipaddr.py | |
# Description: A Python Script to display Private and | |
# Public IP address details in Linux and Unix. | |
# Website: https://gist.github.com/ostechnix | |
# Version: 1.0 | |
# Usage: python showipaddr.py | |
# ------------------------------------------------------------------ |
#!/usr/bin/env bash | |
# ------------------------------------------------------------------ | |
# Script Name: showipaddr.sh | |
# Description: A Bash Script to display Private and | |
# Public IP address details in Linux and Unix. | |
# Website: https://gist.github.com/ostechnix | |
# Version: 1.0 | |
# Usage: chmod +x showipaddr.sh | |
# ./showipaddr.sh |
#!/usr/bin/env bash | |
# ------------------------------------------------------------------ | |
# Script Name: bashmastree.sh | |
# Description: A Bash Script to display a | |
# Christmas tree in Terminal. | |
# Website: https://gist.github.com/ostechnix | |
# Version: 1.0 | |
# Usage: chmod +x bashmastree.sh | |
# ./bashmastree.sh |
import os | |
from collections import Counter | |
def get_history_file(): | |
shell = os.path.basename(os.getenv('SHELL')) | |
if shell == 'bash': | |
return os.path.expanduser('~/.bash_history'), 'bash' | |
elif shell == 'zsh': | |
return os.path.expanduser('~/.zsh_history'), 'zsh' |
#!/usr/bin/env bash | |
# ------------------------------------------------------------------ | |
# Script Name: nmcli_remote_ip_changer.sh | |
# Description: A Bash Script to Assign IP Address to a | |
# Remote Linux System via SSH using nmcli Command. | |
# Website: https://gist.github.com/ostechnix | |
# Version: 1.0 | |
# Usage: chmod +x nmcli_remote_ip_changer.sh | |
# ./nmcli_remote_ip_changer.sh |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)