Skip to content

Instantly share code, notes, and snippets.

View pc-magas's full-sized avatar
🇬🇷
Souvlaki daisuki!!!!!

pc_magas pc-magas

🇬🇷
Souvlaki daisuki!!!!!
View GitHub Profile
@pc-magas
pc-magas / nstall2.sh
Created August 9, 2016 18:50
Instaall script
#!/bin/bash
#Path where all the files will be executed
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
#!/usr/bin/env python
# coding=utf-8
# -*- Mode: python; c-basic-offset: 4 -*-
def convert_into_binary(c):
# We return the binary of c as a STRING
# Each character of the string can be converted it into integer using python's int() function.
return bin(c)[2:]
def square_and_multiply(x,c,n):
@pc-magas
pc-magas / sha256verify.sh
Created May 16, 2018 12:58
SHA256verify hash from a provided hash and file script
#!/bin/bash
#
# Copyright 2018 DESYLLAS DIMITRIOS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@pc-magas
pc-magas / Dockerfile
Created June 18, 2019 08:29
Dockerfile form php developent and CI
ARG BASE_IMAGE=php:7.2-fpm-alpine
FROM ${BASE_IMAGE}
ARG USERID=1000
ARG GROUPID=1000
ENV DOCKER_UID=${USERID} \
DOCKER_GID=${GROUPID} \
PHP_CONF_DIR="/usr/local/etc/php/conf.d" \
FPM_CONF_DIR="/usr/local/etc/php-fpm.d" \
@pc-magas
pc-magas / TestTemp.php
Created July 16, 2019 11:55
A simple code Snipper to check the functionality of `assertEmpty`
<?php
namespace Tests\Unit;
use PHPUnit\Framework\TestCase;
class TestTemp extends TestCase
{
public function testAssertEmpty()
{
const mandrill = require('node-mandrill')('ThisIsMyDummyApiKey');
const sendEmail = async () => {
return await mandrill('/messages/send', {
message: {
to: [{email: '[email protected]', name: 'Jim Rubenstein'}],
from_email: '[email protected]',
subject: "Hey, what's up?",
text: "Hello, I sent this message using mandrill."
#!/usr/bin/env php
<?php
// Input CSV
$csv_file="contacts (3).csv";
// Output file
$ldap="contacts.ldif";
/**
@pc-magas
pc-magas / Html
Created September 17, 2021 11:32
Inline UL with billets except first element
<ul class="list-inline">
<li>
Grece
</li>
<li>
Balkans
</li>
<li>
Fish & Chips
</li>
@pc-magas
pc-magas / output.txt
Created November 4, 2021 11:36
Finaly Example
FinallyPHP Fatal error: Uncaught Exception: dsadsadas in /var/www/html/api/test.php:4
Stack trace:
#0 {main}
thrown in /var/www/html/api/test.php on line 4
Fatal error: Uncaught Exception: dsadsadas in /var/www/html/api/test.php on line 4
Exception: dsadsadas in /var/www/html/api/test.php on line 4
Call Stack:
@pc-magas
pc-magas / Buidling.md
Created July 15, 2022 09:51
Winsock Example

Build in Linux

STEP1: Install Mingw32

sudo apt-get install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 wine64
sudo apt-get install g++-mingw-w64-i686 g++-mingw-w64-i686

STEP2: Compile