<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[פקודה בCMD עם נתון המתקבל ב CURL]]></title><description><![CDATA[<p dir="auto">כשאני מתחבר לשרת שלי מחיבור שעוד לא מוגדר כפתוח בחומת האש אני צריך לפתוח אותו בחומת האש.<br />
יש לי פקודה לקבל את הIP ואז פקודה לפתוח אותו בפורט המבוקש.<br />
אני רוצה ליצור קובץ שמריץ את הכל אוטומטי, כאשר במידת הצורך אני מריץ אותו והכל מבוצע לבד.<br />
להלן הפקודות כהיום:</p>
<pre><code>curl https://checkip.amazonaws.com
</code></pre>
<p dir="auto">הפקודה מחזירה את הIP שלי.</p>
<pre><code>aws ec2 authorize-security-group-ingress --group-id sg-0534sg83sgba4 --protocol tcp --port 22 --cidr 255.255.255.255/24
</code></pre>
<p dir="auto">פקודה זו היא לפתיחת פורט 22, ואני צריך לבצע את אותה פקודה כדי לפתוח גם את פורט 3306.<br />
לאחר הIP צריך להיות /24 (מי שיודע להסביר למה מוזמן להסביר).<br />
אני רוצה קובץ שאני מקליק עליו והפקודות מבוצעות כולל שילוב הIP בפקודות במיקום הנדרש.<br />
תודה מראש</p>
]]></description><link>https://tchumim.com/topic/8984/פקודה-בcmd-עם-נתון-המתקבל-ב-curl</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 15:41:21 GMT</lastBuildDate><atom:link href="https://tchumim.com/topic/8984.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 27 May 2020 17:26:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to פקודה בCMD עם נתון המתקבל ב CURL on Thu, 28 May 2020 07:50:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dovid">@<bdi>dovid</bdi></a><br />
א. כי הבקשה היתה "פקודה בCMD"<br />
ב. כי בברירת מחדל קליק כפול לא מריץ אותו<br />
ג. כי CMD  הרבה יותר מהיר, לא מחכים עד שהמנוע יתחמם...</p>
]]></description><link>https://tchumim.com/post/103312</link><guid isPermaLink="true">https://tchumim.com/post/103312</guid><dc:creator><![CDATA[yossiz]]></dc:creator><pubDate>Thu, 28 May 2020 07:50:50 GMT</pubDate></item><item><title><![CDATA[Reply to פקודה בCMD עם נתון המתקבל ב CURL on Wed, 27 May 2020 22:51:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yossiz">@<bdi>yossiz</bdi></a> למה לא powershell?</p>
]]></description><link>https://tchumim.com/post/103301</link><guid isPermaLink="true">https://tchumim.com/post/103301</guid><dc:creator><![CDATA[dovid]]></dc:creator><pubDate>Wed, 27 May 2020 22:51:24 GMT</pubDate></item><item><title><![CDATA[Reply to פקודה בCMD עם נתון המתקבל ב CURL on Wed, 27 May 2020 18:56:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%97%D7%95%D7%A7%D7%A8">@<bdi>חוקר</bdi></a> אמר ב<a href="/post/103235">פקודה בCMD עם נתון המתקבל ב CURL</a>:</p>
<blockquote>
<p dir="auto">אגב אם יש לך עצבים גם להסביר למה זה בלולאה (אם הבנתי נכון..) אשמח ללמוד קצת על (ווינדוס)..</p>
</blockquote>
<p dir="auto">השאלה אם יש <em><strong>לך</strong></em> עצבים... אין שום סיבה נורמלית שזה בלולאה, זה רק בגלל שהשפה של CMD כל כך פרימיטיבית שזו הדרך היחידה לקלוט פלט של פקודה ולעשות איתו משהו... <img src="https://tchumim.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f644.png?v=9d71ebe86e6" class="not-responsive emoji emoji-android emoji--face_with_rolling_eyes" style="height:23px;width:auto;vertical-align:middle" title=":face_with_rolling_eyes:" alt="🙄" /><br />
אמרתי כבר שאתה לא מפסיד הרבה שאתה לא יודע לכתוב פקודות ב-CMD...</p>
]]></description><link>https://tchumim.com/post/103237</link><guid isPermaLink="true">https://tchumim.com/post/103237</guid><dc:creator><![CDATA[yossiz]]></dc:creator><pubDate>Wed, 27 May 2020 18:56:37 GMT</pubDate></item><item><title><![CDATA[Reply to פקודה בCMD עם נתון המתקבל ב CURL on Wed, 27 May 2020 18:53:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yossiz">@<bdi>yossiz</bdi></a> אמר ב<a href="/post/103226">פקודה בCMD עם נתון המתקבל ב CURL</a>:</p>
<blockquote>
<p dir="auto">FOR /F "tokens=* USEBACKQ" %%F IN (<code>curl https://checkip.amazonaws.com</code>) DO (<br />
SET MYIP=%%F<br />
)</p>
<p dir="auto">aws ec2 authorize-security-group-ingress --group-id sg-0534sg83sgba4 --protocol tcp --port 22 --cidr %MYIP%/32<br />
aws ec2 authorize-security-group-ingress --group-id sg-0534sg83sgba4 --protocol tcp --port 3306 --cidr %MYIP%/32</p>
</blockquote>
<p dir="auto">אגב אם יש לך עצבים גם להסביר למה זה בלולאה (אם הבנתי נכון..) אשמח ללמוד קצת על (ווינדוס)..</p>
]]></description><link>https://tchumim.com/post/103235</link><guid isPermaLink="true">https://tchumim.com/post/103235</guid><dc:creator><![CDATA[חוקר]]></dc:creator><pubDate>Wed, 27 May 2020 18:53:33 GMT</pubDate></item><item><title><![CDATA[Reply to פקודה בCMD עם נתון המתקבל ב CURL on Wed, 27 May 2020 18:26:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yossiz">@<bdi>yossiz</bdi></a> אמר ב<a href="/post/103228">פקודה בCMD עם נתון המתקבל ב CURL</a>:</p>
<blockquote>
<p dir="auto">כמובן צריך שיהיה לך פקודת curl ב-PATH...</p>
</blockquote>
<p dir="auto">כבר יש, לא זכור ממתי ואיך.<br />
תודה!</p>
]]></description><link>https://tchumim.com/post/103229</link><guid isPermaLink="true">https://tchumim.com/post/103229</guid><dc:creator><![CDATA[חוקר]]></dc:creator><pubDate>Wed, 27 May 2020 18:26:13 GMT</pubDate></item><item><title><![CDATA[Reply to פקודה בCMD עם נתון המתקבל ב CURL on Wed, 27 May 2020 18:25:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%97%D7%95%D7%A7%D7%A8">@<bdi>חוקר</bdi></a> אמר ב<a href="/post/103227">פקודה בCMD עם נתון המתקבל ב CURL</a>:</p>
<blockquote>
<p dir="auto">בווינדוס אני לא הכי מתמצא</p>
</blockquote>
<p dir="auto">אתה לא מפסיד הרבה... הפקודה בשביל ווינדוס, אבל? (כמובן צריך שיהיה לך פקודת <code>curl</code> ב-<code>PATH</code>...)</p>
<blockquote>
<p dir="auto">איזה סיומת קובץ</p>
</blockquote>
<p dir="auto">CMD. או BAT.</p>
]]></description><link>https://tchumim.com/post/103228</link><guid isPermaLink="true">https://tchumim.com/post/103228</guid><dc:creator><![CDATA[yossiz]]></dc:creator><pubDate>Wed, 27 May 2020 18:25:55 GMT</pubDate></item><item><title><![CDATA[Reply to פקודה בCMD עם נתון המתקבל ב CURL on Wed, 27 May 2020 18:21:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yossiz">@<bdi>yossiz</bdi></a><br />
צודק מאוד התבלבלתי עם 24 ו 32.<br />
בכל מקרה בווינדוס אני לא הכי מתמצא, אשמח לדעת איזה סיומת קובץ..</p>
]]></description><link>https://tchumim.com/post/103227</link><guid isPermaLink="true">https://tchumim.com/post/103227</guid><dc:creator><![CDATA[חוקר]]></dc:creator><pubDate>Wed, 27 May 2020 18:21:56 GMT</pubDate></item><item><title><![CDATA[Reply to פקודה בCMD עם נתון המתקבל ב CURL on Wed, 27 May 2020 18:13:47 GMT]]></title><description><![CDATA[<pre><code class="language-BASH">FOR /F "tokens=* USEBACKQ" %%F IN (`curl https://checkip.amazonaws.com`) DO (
  SET MYIP=%%F
)

aws ec2 authorize-security-group-ingress --group-id sg-0534sg83sgba4 --protocol tcp --port 22 --cidr %MYIP%/32
aws ec2 authorize-security-group-ingress --group-id sg-0534sg83sgba4 --protocol tcp --port 3306 --cidr %MYIP%/32
</code></pre>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%97%D7%95%D7%A7%D7%A8">@<bdi>חוקר</bdi></a> אמר ב<a href="/post/103217">פקודה בCMD עם נתון המתקבל ב CURL</a>:</p>
<blockquote>
<p dir="auto">לאחר הIP צריך להיות /24 (מי שיודע להסביר למה מוזמן להסביר).</p>
</blockquote>
<p dir="auto">זה לא לגמרי נכון, המספר שאחרי ה-IP היא ה-<a href="https://www.hamichlol.org.il/Subnet_mask" target="_blank" rel="noopener noreferrer nofollow ugc">subnet mask</a> (בפורמט <a href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" target="_blank" rel="noopener noreferrer nofollow ugc">CIDR</a> -- ‏CIDR notation) שאומר כמה ביטים מהכתובת רלוונטיים. אם אתה רוצה לאשר כל ה-IP שמ-10.0.0.0 עד 10.0.0.255 תכתוב 10.0.0.0/24 כלומר תתיחס רק ל-24 ביטים (=3 בייטים) הראשונים.<br />
אתה מן הסתם רוצה לאשר רק את הכתובת שלך, אז אתה צריך לשים שם ‎/32 כלומר, כל הביטים חשובים.</p>
]]></description><link>https://tchumim.com/post/103226</link><guid isPermaLink="true">https://tchumim.com/post/103226</guid><dc:creator><![CDATA[yossiz]]></dc:creator><pubDate>Wed, 27 May 2020 18:13:47 GMT</pubDate></item></channel></rss>