Skip to content

Instantly share code, notes, and snippets.

View farukterzioglu's full-sized avatar
🎯
Focusing

Faruk Terzioğlu farukterzioglu

🎯
Focusing
View GitHub Profile
@farukterzioglu
farukterzioglu / delete_git_submodule.md
Created February 4, 2021 10:16 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
<ItemGroup>
<PackageReference Include="Nethereum.Web3" Version="3.8.0" />
<PackageReference Include="Nethereum.ABI" Version="3.8.0" />
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="NBitcoin.Secp256k1" Version="1.0.1" />
<PackageReference Include="NBitcoin" Version="5.0.27" />
<PackageReference Include="RestSharp" Version="106.10.1" />
<PackageReference Include="Moq" Version="4.14.6" />
@farukterzioglu
farukterzioglu / Response.txt
Last active December 10, 2019 08:19
multisig-test
ScriptError [ScriptError]:EvalFalse
ScriptVerify : [ScriptVerify]:StrictEnc | MinimalData | DiscourageUpgradableNops | CleanStack | Consensus | DiscourageUpgradableWitnessProgram | MinimalIf | NullFail
var inputList = new List<UnspentCoin>();
var unspentResponse = await client.ListUnspentAsync();
var unspentList = unspentResponse.OrderByDescending( x => x.Amount).ToList();
var inputBtcSum = new Money(0, MoneyUnit.BTC);
foreach (var unspent in unspentList) {
if( inputBtcSum >= totalPaymentAmountBtc) break;
inputBtcSum += unspent.Amount;
inputList.Add(unspent);
}
@farukterzioglu
farukterzioglu / bitcoin.cs
Created October 19, 2019 21:11
bitcoin sample
Dictionary<string, int> salaries = GetSalaryList();
...
Dictionary<string, int> GetSalaryList()
{
return new Dictionary<string, int>(){
{ "2N2LGTF2XWA5png8mT2fbHRzY9P4XDLWvGc", 2500},
{ "2N94h5bWDAFNsd7SB1f3cQ6RUMmoMaA44tQ", 4500},
{ "2MsjZP4DJmZeV1fRpAw8NcJWiibYopWL7fg", 2250},
{ "2N1cHqXYLas7bnLoCtMppD1yKtrXjRSmB5M", 10000},
{ "2NA9di1yBdHiwgJJVB27nPxpAc8YDpmdSS1", 12500}
@farukterzioglu
farukterzioglu / bitcoin.cs
Created October 19, 2019 20:57
bitcoin sample
var network = Network.RegTest;
var client = new RPCClient(
credentials: new NetworkCredential(
userName: "myuser",
password: "SomeDecentp4ssw0rd"),
address: new Uri("http://127.0.0.1:443"),
network: network);
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageType>Template</PackageType>
<PackageId>Worker.Extended</PackageId>
<Title>Worker Service (Extended)</Title>
<Authors>Faruk Terzioğlu</Authors>
<Description>Pretty much full project template for creating a worker service.</Description>
...
</PropertyGroup>
{
"author": "Faruk Terzioglu",
"name": "Worker Service (Extended)",
"description": "Pretty much full project template for creating a worker service.",
"groupIdentity": "Microsoft.Worker.Extended",
"identity": "Microsoft.Worker.Extended.CSharp.3.1",
"shortName": "workerextended",
"sourceName": "Company.Application1",
"primaryOutputs": [
{
@farukterzioglu
farukterzioglu / nodeos_full_node_setup.txt
Created October 4, 2019 07:53 — forked from cc32d9/nodeos_full_node_setup.txt
nodeos installation with ZFS
apt-get update && apt-get install -y aptitude git lxc-utils zfsutils-linux netfilter-persistent sysstat
# find the partition ID that is linked to the storage serial number.
# This will prevent from losing the partition if disk mapping changes
ls -l /dev/disk/by-id/ | grep sda6
zpool create -f zdata /dev/disk/by-id/wwn-0x600507604092b628236df4851535cef5-part6
## Fixate internal IP address of the container
systemctl stop lxc-net
sed -i -e 's,^.*LXC_DHCP_CONFILE,LXC_DHCP_CONFILE,' /etc/default/lxc-net
[Test]
public async Task GenerateAddresses()
{
var wallet = new Wallet("carry fix final shield cruel learn pave during habit adapt alter habit", "");
string[] addressList = new string[5];
for (int i = 0; i < 5; i++)
{
var account = wallet.GetAccount(i);
addressList[i] = account.Address;