Skip to content

Instantly share code, notes, and snippets.

View pmcfernandes's full-sized avatar
🏠
Working from home

Pedro Fernandes pmcfernandes

🏠
Working from home
View GitHub Profile
#!/bin/bash
sudo -v
# upgrade distro
apt update
apt upgrade -y
# install curl and ollama
apt install curl -y
@pmcfernandes
pmcfernandes / 1st_sample_sendmail_in_sqlserver.sql
Last active December 10, 2023 17:37
Send emails from MS SQL server
EXEC xp_ConfigureMailServer
DECLARE @Content VARCHAR(max),
@ContentOut VARCHAR(max)
EXEC xp_GetFileContent 'C:\Users\pmcfe\Desktop\1.txt', @Content OUTPUT
DECLARE @vars AS TemplateVars
INSERT INTO @vars ([Name], [Value]) VALUES ('Name', 'Michael Franq')
INSERT INTO @vars ([Name], [Value]) VALUES ('Position', 'Head of Development')
@pmcfernandes
pmcfernandes / .env
Last active November 24, 2023 16:29
create docker in ubuntu
# place here variables
SQLSEVER_PORT=1454
PARISH_SLUG=xpto
@pmcfernandes
pmcfernandes / erc20_one_file
Created September 14, 2022 21:45 — forked from AndreiD/erc20_one_file
ERC20 Token One File
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
@pmcfernandes
pmcfernandes / enable-virtualbox-with-hyperv.txt
Created June 19, 2022 22:56
Enable Hyper-V and VirtualBox at same time.
cd "C:\Program Files\Oracle\VirtualBox"
VBoxManage setextradata "<VM Name>" "VBoxInternal/NEM/UseRing0Runloop" 0
@pmcfernandes
pmcfernandes / unraid_mount.md
Created June 13, 2022 00:48 — forked from helinwang/unraid_mount.md
Unraid: mount a unraid share using the unraid mount tag in Ubuntu

Mounting the shared path You can mount the shared folder using

mount -t 9p -o trans=virtio [mount tag] [mount point] -oversion=9p2000.L

mount tag: As specified in Qemu commandline. mount point: Path to mount point. trans: Transport method (here virtio for using 9P over virtio) version: Protocol version. By default it is 9p2000.u . Other options that can be used include:

var realFavicon = require ('gulp-real-favicon');
var fs = require('fs');
// File where the favicon markups are stored
var FAVICON_DATA_FILE = 'faviconData.json';
// Generate the icons. This task takes a few seconds to complete.
// You should run it at least once to create the icons. Then,
// you should run it whenever RealFaviconGenerator updates its
// package (see the check-for-favicon-update task below).
@pmcfernandes
pmcfernandes / hosts.txt
Last active April 5, 2022 14:10
My AdGuard DNS Block List
# Comment here
||redtube.com^
||mi.com^
||idealista.pt^
@pmcfernandes
pmcfernandes / install.ps1
Last active April 21, 2024 15:12
Install all common software for development pc via Chocolatery
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'));
choco install adobereader -y
choco install python3 -y
choco install visualstudio-installer -y
choco install zoom -y
choco install winrar -y
choco install nodejs.install -y
choco install ccleaner -y
@pmcfernandes
pmcfernandes / install.sh
Last active February 26, 2021 23:53
Install my software in alpine
#!/bin/bash
apk add sudo alsa-utils alsa-utils-doc alsa-lib alsaconf neofetch htop bc \
alpine-sdk nodejs npm python3 mutt mc w3m tmux zsh cmus mplayer \
weechat
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
addgroup $USER audio
addgroup root audio