Skip to content

Instantly share code, notes, and snippets.

@nycdavid
nycdavid / giospr1-notes.md
Last active January 2, 2024 07:14
Notes for GIOS Project 1

This turned out a bit longer than I expected, so here's the conclusion

Echo Server/Client

Although there was a bit of ramp up time, I found this portion of the project to be a great primer on creating, connecting to and transmitting with sockets.

As far as resources go, I may very well be in the minority in that I didn't find things like Beej's Guide to Network Programming or the Linux Programming Interface to be particularly helpful as a first resource for this exercise. As thorough as they are, they were almost too indepth and I wound up inadvertently complicating things by attempting to apply the patterns in it.

The best resources for me were:

@Sporif
Sporif / nvidia.sgrd
Last active July 21, 2023 06:47
ksysguard sensor file for Nvidia. Requires https://gist.github.com/Sporif/4ce63f7b6eea691bdbb18905a9589169 to be in path
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE KSysGuardWorkSheet>
<WorkSheet title="Nvidia" columns="2" rows="4" locked="0" interval="1">
<host name="127.0.0.1" port="-1" shell="" command="nvidia-gpu-sensor.pl"/>
<display labels="1" svgBackground="" vScroll="1" version="1" class="FancyPlotter" vLines="1" unit="" row="0" hScale="3" autoRange="1" fontSize="8" manualRange="0" rowSpan="1" columnSpan="1" showUnit="0" vDistance="30" column="0" stacked="0" title="GPU Temp" hLines="1">
<beam sensorName="gpu_temp" sensorType="integer" color="0xff0057ae" hostName="127.0.0.1"/>
</display>
<display labels="1" svgBackground="" vScroll="1" version="1" class="FancyPlotter" vLines="1" unit="" row="0" hScale="3" autoRange="1" fontSize="8" manualRange="0" rowSpan="1" columnSpan="1" showUnit="0" vDistance="30" column="1" stacked="0" title="GPU Fan Speed" hLines="1">
<beam sensorName="gpu_fan_speed" sensorType="integer" color="0xff0057ae" hostName="127.0.0.1"/>
</display>
@Sporif
Sporif / nvidia-gpu-sensor.pl
Last active July 21, 2023 06:47 — forked from hacker1024/nvidia-gpu-sensor.pl
KDE KSysGuard NVIDIA GPU temperature/memory/utilization sensor, based on @frantic1048's script, but with units and total memory detection.
#!/usr/bin/perl -w
# act as a KSysGuard sensor
# provides NVIDIA GPU info via `nvidia-smi`
# Usage:
# 1. Save this script, make it executable and move it to a directory in your $PATH
# 2. Save this ksysguard sensor file for Nvidia: https://gist.github.com/Sporif/31f0d8d9efc3315752aa4031f7080d79
# 2. In KSysGuard's menu, open "File > Import Tab From File option"
# 3. Open the sensor file (nvidia.srgd)
@zparnold
zparnold / one_liner.sh
Last active May 6, 2024 13:14
A simply script to delete all failed pods from Kubernetes
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active May 7, 2024 22:00
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@lrascao
lrascao / gist:f57312ff33b799c4c0db56b10e80fe26
Created March 31, 2016 16:19
Export/Import datadog dashboards
dash_id=xxxx
api_key=xxx
app_key=xxx
# 1. export
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json
# 2. edit dash.json
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level

Kubernetes + AWS ECR = ❤️

Makefile and YAML templates for automating the use of AWS Elastic Container Registry with Kubernetes.

Based off of this awesome Redsaid blog post.

Requirements

  • Amazon ECR, along with your AWS account ID and the region your ECR is in
  • AWS CLI
@melvincabatuan
melvincabatuan / latex install
Created August 25, 2015 23:45
Centos 7 latex install
yum -y install texlive texlive-latex texlive-xetex
yum -y install texlive-collection-latex
yum -y install texlive-collection-latexrecommended
yum -y install texlive-xetex-def
yum -y install texlive-collection-xetex
Only if needed:
yum -y install texlive-collection-latexextra
@ghostbar
ghostbar / loggly.service
Created March 26, 2015 22:57
loggly.service
[Unit]
Description=Loggly Forwarder
[Service]
ExecStart=/bin/sh -c "journalctl -o short -f | awk '{ print \"\<34\>1\", $0; fflush(); }' | awk '{ print $0, \"[your-consumer-token-from-loggly@41058 tag='deis']\" }' | ncat --ssl logs-01.loggly.com 6514"
[Install]
WantedBy=multi-user.target
[X-Fleet]
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active April 25, 2024 22:55
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /