Skip to content

Instantly share code, notes, and snippets.

@samuelsadok
samuelsadok / dmesg
Created January 2, 2018 06:49
linux-usb: [BUG] SD card reader disappears after suspend
[ 0.000000] microcode: microcode updated early to revision 0x17, date = 2017-01-27
[ 0.000000] Linux version 4.14.8-1-ARCH (builduser@heftig-11417) (gcc version 7.2.1 20171128 (GCC)) #1 SMP PREEMPT Wed Dec 20 21:27:44 UTC 2017
[ 0.000000] Command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=/dev/mapper/MainVolGroup-root rw resume=/dev/mapper/MainVolGroup-swap quiet modprobe.blacklist=i915 intel_iommu=on systemd.unit=multi-user.target
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000057fff] usable
@RKX1209
RKX1209 / s2e-internal.md
Last active February 26, 2024 07:47
S2E source code internal

S2E internal

td;al

s2e_qemu_tb_execが中心。tryでパスを実行して、例えばsymbolicなデータへのアクセスがあったりパスのマージ要求があったり、割り込みが入って制御が変わったり、Annotationによって明示的に枝刈り指定(m_doSkip)されるなどの場合、CpuExitExceptionが投げられcpu_execまで戻ってs2e_qemu_finalize_tb_execでTBクリアしてやりなおし(別のパスの実行を始める) これがconcrete->symbolicへの切り替え。 またSymbolic Execution中のパス選択はsearcherがnextStateで気める。stateはrestoreYieldedState->resumeState関数内でsearcher->addStateで追加する。SymDriveはこのsearcherのアルゴリズムを特殊なオペコード挿入などで賢く枝刈りするようにした物。

init_env

S2Eはゲストのどの変数シンボル化するなどの情報を受け取る必要がある。これには2つの方法があり、一つはターゲットのプログラムのソースを変更してs2e_make_symbolicを呼び出す事。2つ目はLD_PRELOADでバイナリ修正無しでフックして通知する。 init_envをLD_PRELOADに指定することでゲスト内でターゲットプログラム実行時の__libc_start_mainをフックしてS2Eに知らせる。

@mirchr
mirchr / opcodes.sh
Created July 23, 2017 02:31 — forked from offlinemark/opcodes.sh
bash one-liner for converting binary object file to shellcode ( i didn't write this)
for i in $(objdump -d shell.o -M intel |grep "^ " |cut -f2); do echo -n '\x'$i; done;echo
@cschiewek
cschiewek / x11_docker_mac.md
Last active March 25, 2025 13:23
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package:

@superbiche
superbiche / remove-firefox-sound-tab.scss
Created August 24, 2016 14:08
Disable sound indicator in Firefox tabs Useful if video is muted but the indicator is still visible (PLEASE keep this indicator if you play sound)
// Only pinned tabs
.tabbrowser-tab[pinned] :-moz-any(.tab-icon-overlay[soundplaying]) {
display: none;
}
// Any tab
.tabbrowser-tab :-moz-any(.tab-icon-sound,.tab-icon-overlay[muted]) {
display: none;
}
@danilogr
danilogr / async_http_server.cpp
Last active March 2, 2024 10:34
Asynchronous HTTP server written in C++ using boost::asio
/**
* danilod100 at gmail.com
* Compile with: g++ async_http_server.cpp -o async_http_server -lboost_system -lboost_thread -lpthread
*
* */
#include <iostream>
#include <ostream>
#include <istream>
#include <ctime>
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active April 27, 2025 09:56
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:

@subfuzion
subfuzion / curl.md
Last active May 13, 2025 18:51
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@vidavidorra
vidavidorra / auto-deploy_documentation.md
Last active June 5, 2024 19:20
Auto-deploying Doxygen documentation to gh-pages with Travis CI

Auto-deploying Doxygen documentation to gh-pages with Travis CI

This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages branch using Travis CI. This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.

Sign up for Travis CI and add your project

Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.

Create a clean gh-pages branch

To create a clean gh-pages branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th