Skip to content

Commit

Permalink
GitHub requires execution count, let's normalize it to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
huettenhain committed Nov 12, 2024
1 parent f9f14c9 commit 0bb9058
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 1 deletion.
5 changes: 4 additions & 1 deletion strip-tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
import json
import pathlib

CK = 'execution_count'

for path in pathlib.Path.cwd().glob('./tutorials/*.ipynb'):
with path.open('r') as fd:
notebook = json.load(fd)
for cell in notebook['cells']:
cell.pop('execution_count', None)
if CK in cell:
cell[CK] = 1
with path.open('w') as fd:
json.dump(notebook, fd, indent=1)
22 changes: 22 additions & 0 deletions tutorials/tbr-files.v0x01.netwalker.dropper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -45,6 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -77,6 +79,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -116,6 +119,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -155,6 +159,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -193,6 +198,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -201,6 +207,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -231,6 +238,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -267,6 +275,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -318,6 +327,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -326,6 +336,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand All @@ -345,6 +356,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -353,6 +365,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -368,6 +381,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -411,6 +425,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -519,6 +534,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -568,6 +584,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -628,6 +645,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -689,6 +707,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -719,6 +738,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -759,6 +779,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -791,6 +812,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down
6 changes: 6 additions & 0 deletions tutorials/tbr-files.v0x02.amadey.loader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -29,6 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -58,6 +60,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -119,6 +122,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -151,6 +155,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -206,6 +211,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down
8 changes: 8 additions & 0 deletions tutorials/tbr-files.v0x03.seduploader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -30,6 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -75,6 +77,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -188,6 +191,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -265,6 +269,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -352,6 +357,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -395,6 +401,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -454,6 +461,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down
6 changes: 6 additions & 0 deletions tutorials/tbr-files.v0x04.run.length.encoding.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -22,6 +23,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand All @@ -47,6 +49,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -89,6 +92,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -131,6 +135,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -169,6 +174,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down
Loading

0 comments on commit 0bb9058

Please sign in to comment.