Skip to content

Instantly share code, notes, and snippets.

View IdanBanani's full-sized avatar

Idan BananI IdanBanani

View GitHub Profile
@eristoy
eristoy / Linux thingys.txt
Created March 1, 2018 16:18
Usefull -/+/? Linux Cmds
Command Editing Shortcuts
Ctrl + a – go to the start of the command line
Ctrl + e – go to the end of the command line
Ctrl + k – delete from cursor to the end of the command line
Ctrl + u – delete from cursor to the start of the command line
Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
Ctrl + xx – move between start of command line and current cursor position (and back again)
Alt + b – move backward one word (or go to start of word the cursor is currently on)
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active May 28, 2024 19:14
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@EvieePy
EvieePy / music.py
Last active March 7, 2024 21:00
Basic music with playlist support on Rewrite
"""
Please understand Music bots are complex, and that even this basic example can be daunting to a beginner.
For this reason it's highly advised you familiarize yourself with discord.py, python and asyncio, BEFORE
you attempt to write a music bot.
This example makes use of: Python 3.6
For a more basic voice example please read:
https://github.com/Rapptz/discord.py/blob/rewrite/examples/basic_voice.py
@Pulimet
Pulimet / AdbCommands
Last active June 2, 2024 05:56
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@peteristhegreat
peteristhegreat / linux-one-liners.md
Last active September 2, 2023 17:09
Linux notes

Miscellaneous Linux Commands

Introduction

Linux users are expected to interact with the Linux systems quickly and efficiently.

A bare minimum number of commands will get you by, but if you are interested in sharing what works for you, or common/favorite one-liners or pieces of your bash script continue reading.

General Links

@Jinmo
Jinmo / jni_all.h
Created May 26, 2017 07:36
Useful when reversing JNI on IDA Pro
/*
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@wojteklu
wojteklu / clean_code.md
Last active June 2, 2024 19:48
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

#!/bin/sh
IMG=zImage
[ -n "$1" ] && IMG="$1"
binwalk -y gzip -e "$IMG"
mv _"$IMG".extracted/* piggy && rmdir _"$IMG".extracted
if [ -f piggy ]; then
ls -l piggy
[ -f piggy ] && ( strings piggy | grep 'Linux version' )
@demoive
demoive / Bash Notes
Last active July 31, 2020 19:07
Reference for commands/utilities for use in CLI on Unix and Mac OS X
# use:
# .bash_profile - only gets executed for login bash shells
# .bashrc - only gets executed for NON-login bash shells for only NON-login shells
# .profile - gets executed for ANY login shell
# .bash_logout - only gets executed for bash shells after logout
# Sets the prompt:
#PS1='\h:\w \u\$ '
#PS2='> '