├── .temp └── .gitkeep ├── LICENSE ├── README.org ├── _config.yml ├── blog.org ├── config ├── css └── stylesheet.css ├── doc ├── .gitignore ├── README.md └── guia_castellano.md ├── docs ├── .gitignore ├── README.md └── _config.yml ├── emacs.xml ├── feed.xml ├── icon ├── github.png ├── podcast.png ├── rss.png ├── spotify.png ├── telegram.png ├── twitter.png ├── ugeek-256x256.png ├── ugeek.jpg └── ugeek.png ├── images-blog └── sed.png ├── index.md ├── js ├── jquery.min.js ├── tipuesearch.min.js └── tipuesearch_set.js ├── list.html ├── org-bash-blog ├── org-bash-blog.html ├── org └── unix.org ├── post └── 2018-12-27-eliminar-lineas-en-blanco.html ├── program └── .gitkeep ├── tag.html └── ugeek.png /.temp/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/.temp/.gitkeep -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | * TODO Org-Bash-Blog. Creando un blog estático desde un único archivo orgmode 2 | :PROPERTIES: 3 | :TITLE: Org-Bash-Blog. Creando un blog estático desde un único archivo orgmode 4 | :EXPORT_FILE_NAME: org-bash-blog-creando-un-blog-estatico-desde-un-unico-archivo-orgmode 5 | :DESCRIPTION: 6 | :EXPORT_DATE: 2021-01-05 23:04 7 | :CATEGORY: web 8 | :TAG: orgmode,emacs,git,github,gitlab 9 | :IMAGE: ./images-blog/bash.png 10 | :END: 11 | 12 | Cree un blog a partir de un único archivo en orgmode, con toda la potencia de bash. 13 | #+HTML:
14 | [[./images-blog/bash.png]] 15 | #+HTML:
16 | 17 | Conservando el archivo blog.org, con la totalidad del contenido del blog en texto plano y org-bash-blog, en cualquier lugar puedes levantar el blog en segundos. 18 | 19 | ** Ventajas respecto a otro tipo de blogs y objetivos 20 | 21 | - Aprovechando las ventajas del formato y sintaxis orgmode, tener todo el blog en un único archivo de texto plano, y a partir de este, con un solo clic levantar un blog estático HTML ultraligero y sin base de datos, en cualquier tipo de servidor web o local. 22 | - Poder ir redactando tus artículos y programarlos para que se publiquen automáticamente 23 | - Depositar en la carpeta *org*, archivos .org independientes con el nombre de la categoría y con todos los artículos de esa categoría. 24 | - Si te gusta Markdown, también puedes crear tus artículos en Markdown e importarlos con Org-Bash-Blog 25 | 26 | ** Características del Blog 27 | 28 | #+BEGIN_EXAMPLE 29 | - Genera el RSS del blog y RSS por categorías 30 | - Genera página Home, con los cinco últimos artículos publicados 31 | - Genera página con un índice de la totalidad de los artículos publicados, ordenados por fecha 32 | - Genera página ordenada tags, de un modo inteligente 33 | - En cada artículo, sugerencia a otro post de la misma categoría 34 | - Poder utilizar Google Analytics o similar 35 | - Añadir fecha de modificación de un artículo 36 | - Programación de publicación de Post 37 | - Publicación mediante git 38 | - Utiliza sintaxis orgmode, podiendo añadir imágenes, tablas, cajetillas de código… 39 | - También puedes importar artículos en markdown 40 | #+END_EXAMPLE 41 | 42 | ** Ventajas respecto a otro tipo de blogs y objetivos 43 | 44 | - Aprovechando las ventajas del formato y sintaxis orgmode, tener todo el blog en un único archivo de texto plano, y a partir de este, con un solo clic levantar un blog estático HTML ultraligero para cualquier tipo de servidor web (conservando el archivo blog.org, con la totalidad del contenido del blog en texto plano y Org-Bash-Blog, en cualquier lugar puedes levantar el blog) 45 | - Poder ir redactando tus artículos y programarlos para que se publiquen automáticamente 46 | - Depositar en la carpeta *org*, archivos .org independientes con el nombre de la categoría y con todos los post de esa categoría. 47 | 48 | ** Instalación 49 | 50 | Clonaremos el repositorio de Org-Bash-Blog 51 | 52 | #+BEGIN_EXAMPLE 53 | git clone https://github.com/uGeek/org-bash-blog.git ; cd org-bash-blog 54 | #+END_EXAMPLE 55 | 56 | Instalaremos Org-Bash-Blog en nuestro sistema, actualizaremos la ruta de configuración e intalaremos todos los paquetes necesarios. 57 | 58 | #+BEGIN_EXAMPLE 59 | sudo ./org-bash-blog -i 60 | #+END_EXAMPLE 61 | 62 | ** Paquetes necesarios 63 | 64 | Para el correcto funcionamiento de Org-Bash-Blog, necesitamos instalar los siguientes paquetes. Si has instalado Org-Bash-Blog en tu sistema, no será necesario. 65 | 66 | #+BEGIN_EXAMPLE 67 | sudo apt install bash pandoc xml2 wget bc whiptail 68 | #+END_EXAMPLE 69 | 70 | Instalar Calcurse si deseas ver los días de publicación de forma gráfica 71 | 72 | #+BEGIN_EXAMPLE 73 | sudo apt install calcurse 74 | #+END_EXAMPLE 75 | 76 | Si vas a hospedar tu blog en GitHub, GitLab,... Necesitarás también git 77 | 78 | #+BEGIN_EXAMPLE 79 | sudo apt install git 80 | #+END_EXAMPLE 81 | 82 | ** Ostras Distribuciones no derivadas de Debian 83 | 84 | Si utilizas distribuciones no derivadas de Debian, Org-Bash-Blog funcionará perfectamente, pero es necesario instalar los paquetes: 85 | 86 | - bash 87 | - pandoc 88 | - xml2 89 | - wget 90 | - bc 91 | - whiptail 92 | - calcurse 93 | - git 94 | 95 | ** Creando la configuración del Blog 96 | 97 | Situados en el directorio donde vamos a construir el blog, donde hemos clonado el repositorio de Org-Bash-Blog y están los archivos *config* y *org-bash-blog*, ejecutaremos el siguiente comando: 98 | 99 | #+BEGIN_EXAMPLE 100 | sudo ./org-bash-blog -i 101 | #+END_EXAMPLE 102 | 103 | Esto editará de forma automática la ruta del archivo de configuración y configurará la ruta del blog en el archivo de configuración. 104 | 105 | Puedes cambiar la ruta del archivo de configuración donde desees 106 | 107 | *** Configuración manual 108 | 109 | Abre con tu editor de texto favorito el archivo /*org-bash-blo*/*g* y busca en las primeras líneas, donde aparece *source.* 110 | 111 | Escribe la ruta completa donde está el archivo *config.* Podrías dejarlo dentro de la misma carpeta, pero no es obligatorio. 112 | 113 | Edita el archivo *config*, añadiendo todas aquellas variables que aparecen, como la ruta de la carpeta del blog, editor de texto, navegador, etc ... 114 | 115 | ** Creando estructura de directorios y el archivo blog.org 116 | 117 | *** Creando estructura de directorios 118 | 119 | En el caso que no hubieras clonado el repositorio, este comando creará toda la estructura de directorios 120 | 121 | #+BEGIN_EXAMPLE 122 | org-bash-blog -b 123 | #+END_EXAMPLE 124 | 125 | *** Creando archivo blog.org 126 | 127 | En el archivo blog.org, estará todo el contenido del blog. Vamos a crearlo. Si h 128 | 129 | #+BEGIN_EXAMPLE 130 | org-bash-blog -f blog.org 131 | #+END_EXAMPLE 132 | 133 | En cabecera del archivo *blog.org*, añade el Título del blog, url del blog, Descripción, Palabras clave del blog y autor. 134 | 135 | #+BEGIN_EXAMPLE 136 | #+TITLE: Título 137 | #+LINK: https://miblog.org 138 | #+DESCRIPTION: Este es mi nuevo blog 139 | #+KEYWORDS: personal, notas 140 | #+AUTHOR: angel 141 | #+END_EXAMPLE 142 | 143 | ** Archivo program.org y draft.org 144 | 145 | - *draft.org*, es una archivo donde iremos creando artículos para un futuro o artículos en sucio. 146 | - *program.org*, es el archivo donde importaremos los artículos de *draft.org*, podremos *previsualizarlos* en formato .html en nuestro navegador antes de su publicación, añadirá las descripción del artículo para ser publicado en el feed y quedará aquí a la espera programado, esperando el dia y hora de su publicación. 147 | 148 | Tanto el archivo *draft.org* como *program.org*, no necesitan la cabecera en la parte superior como el archivo *blog.org.* 149 | 150 | *El único requisito importante, todos los Artículos tanto en el archivo blog.org y program.org, tienen que estar en estado TODO* 151 | 152 | Vamos a crear los archivos *draft.org* y *program.org.* Entraremos en el directorio =/program= y crearemos los archivos: 153 | 154 | #+BEGIN_EXAMPLE 155 | cd program/ ; touch draft.org program.org 156 | #+END_EXAMPLE 157 | 158 | ** Creando el Primer Artículo 159 | 160 | Para crear un artículo, es tan sencillo como escribir en tu terminal: 161 | 162 | #+BEGIN_EXAMPLE 163 | org-bash-blog -n 164 | #+END_EXAMPLE 165 | 166 | *Org-bash-blog* nos hará una serie de preguntas sobre el Artículo a que vamos a crear, como: 167 | 168 | - Título 169 | - Categoria 170 | - Etiquetas 171 | - Nombre de la imagen de referencia en el Post. Ejemplo imagen.jpg 172 | - La url de esta imagen, si está en un servidor. *Org-bash-blog* descargará la imagen en el directorio =**images-blog/**= y la renombrara con el nombre de imagen que le hemos dado 173 | 174 | Si hemos seleccionado *Emacs* como editor de texto, abrirá *Emacs* con el archivo *draft.org.* 175 | 176 | En la cabecera, aparecerá la fecha y hora actual, como ejemplo. 177 | 178 | *No es necesario añadir la descripción, ya que org-bash-blog lo creará después de forma automática* 179 | 180 | ** Importación desde archivos markdown 181 | 182 | Si has utilizado otro editor externo y has creado el artículo en un archivo markdown, puedes importarlo a Org-Bash-Blog. Estén donde estén esos archivos ejecuta: 183 | 184 | #+BEGIN_EXAMPLE 185 | org-bash-blog -nim archivo.md 186 | #+END_EXAMPLE 187 | 188 | ** Previsualizando el Artículo 189 | 190 | Para previsualizar el artículo que hemos creado, tenemos que pasar este del archivo *draft.org* a *program.org*. Para ello tenemos que poner el artículo o artículos que queremos pasar a *program.org* en estado =PROGRAM=. Una vez hayamos especificado este estado, teclearemos el comando: 191 | 192 | #+BEGIN_EXAMPLE 193 | org-bash-blog -d 194 | #+END_EXAMPLE 195 | 196 | Esto enviará todos los archivos de *draft.org* con estado =PROGRAM= al archivo program.org 197 | 198 | En *draft.org*, todos los archivos enviados a *program.org*, no serán borrados, permanecerán en *draft.org* pero pasarán al estado *DONE*. 199 | 200 | ** Previsualizar los Artículos 201 | 202 | Para generar archivos html y ver una vista previa de los artículos que están en el archivo *program.org*, utilizaremos la opción *-w* seguido del archivo *program.org* 203 | 204 | #+BEGIN_EXAMPLE 205 | org-bash-blog -w program.org 206 | #+END_EXAMPLE 207 | 208 | - Al salir de la previsualización, *org-bash-blog habrá rellenado la Descripción del Post con las primeras 30 palabras del artículo* 209 | - Creará una página índice con todos los enlaces a las páginas generadas para la previsualización. 210 | - Estás páginas serán eliminadas cuando utilicemos la opción *-p* para programar el artículos. 211 | 212 | ** Programar Artículos 213 | 214 | Utilizando la opción *-p*, todos los artículos que estén en *program.org*, serán programados con la fecha y hora que indican. 215 | 216 | *Es necesario estar dentro del directorio donde está el archivo program.org para programarlo*. 217 | 218 | #+BEGIN_EXAMPLE 219 | org-bash-blog -p 220 | #+END_EXAMPLE 221 | 222 | Si la carpeta contenía archivos html de la previsualización anterior, serán eliminados. 223 | 224 | Para ver los Artículos que tenemos programados, utilizaremos la opción *-h* de ayuda. En la parte inferior de la ayuda aparecen todos los archivos programados con su título, fecha y hora. 225 | 226 | #+BEGIN_EXAMPLE 227 | org-bash-blog -h 228 | #+END_EXAMPLE 229 | 230 | Cuando llegue la fecha y hora, el Artículo programado, org-bash-blog pasará el artículo programado del archivo *program.org* al archivo *blog.org*. 231 | 232 | *Cada vez que modifiques el archivo program.org o modifiques una fecha de publicación, tienes que ejecutar* =org-bash-blog -p= *para que org-bash-blog los ordene por fecha para la publicación.* 233 | 234 | #+BEGIN_EXAMPLE 235 | org-bash-blog -p 236 | #+END_EXAMPLE 237 | 238 | ** Calendario de Publicaciones 239 | 240 | Si deseas ver la programación de los artículos programados mediante un calendario, ejecuta: 241 | 242 | #+BEGIN_EXAMPLE 243 | org-bash-blog -cal 244 | #+END_EXAMPLE 245 | 246 | Org-Bash-Blog abrirá calcurse y verás los días programados en el calendario con el título seguido de # org-bash-blog 247 | 248 | ** Publicación manual o modificación de Artículo 249 | 250 | Si queremos modificar o eliminar algún artículo publicado, lo haremos en el archivo *blog.org*. 251 | 252 | Para que el cambio ejecutar este cambio 253 | 254 | #+BEGIN_EXAMPLE 255 | org-bash-blog blog.org 256 | #+END_EXAMPLE 257 | 258 | *Org-bash-blog* creará todas las páginas .html, index.html, list.html, tag.html y el archivo feed.xml 259 | 260 | ** Publicación en GitHub, GitLab,... 261 | 262 | Si tu blog está en repositorio tipo git, puedes hacer un git push desde cualquier directorio con: 263 | 264 | #+BEGIN_EXAMPLE 265 | org-bash-blog -g 266 | #+END_EXAMPLE 267 | 268 | ** Editar draft 269 | 270 | Abre el archivo *draft.org* con emacs en modo gráfico. 271 | 272 | #+BEGIN_EXAMPLE 273 | org-bash-blog draft 274 | #+END_EXAMPLE 275 | 276 | Abre el archivo *draft.org* con emacs en modo terminal 277 | 278 | #+BEGIN_EXAMPLE 279 | org-bash-blog draftt 280 | #+END_EXAMPLE 281 | 282 | ** Editar program 283 | 284 | Abre el archivo *program.org* con emacs en modo gráfico. 285 | 286 | #+BEGIN_EXAMPLE 287 | org-bash-blog program 288 | #+END_EXAMPLE 289 | 290 | Abre el archivo *program.org* con emacs en modo terminal 291 | 292 | #+BEGIN_EXAMPLE 293 | org-bash-blog programt 294 | #+END_EXAMPLE 295 | 296 | ** Editar blog 297 | 298 | Abre el archivo *blog.org* con emacs en modo gráfico. 299 | 300 | #+BEGIN_EXAMPLE 301 | org-bash-blog blog 302 | #+END_EXAMPLE 303 | 304 | Abre el archivo *blog.org* con emacs en modo terminal 305 | 306 | #+BEGIN_EXAMPLE 307 | org-bash-blog blogt 308 | #+END_EXAMPLE 309 | 310 | ** Resumen del proceso, creación, programación, publicación de un Artículo 311 | 312 | draft -> program -> blog 313 | 314 | Crea un nuevo artículo en draft 315 | 316 | #+BEGIN_EXAMPLE 317 | org-bash-blog -n 318 | #+END_EXAMPLE 319 | 320 | Si lo quieres importar desde un archivo markdown 321 | 322 | #+BEGIN_EXAMPLE 323 | org-bash-blog -nim archivo.md 324 | #+END_EXAMPLE 325 | 326 | Para enviar artículos de draft.org a program.org, cambiamos del estado *TODO* A *PROGRAM* y ejecutamos el comando: 327 | 328 | #+BEGIN_EXAMPLE 329 | org-bash-blog -d 330 | #+END_EXAMPLE 331 | 332 | Para previsualizarlo y que org-bash-blog añada la descripción del artículo para el feed: 333 | 334 | #+BEGIN_EXAMPLE 335 | org-bash-blog -w programa.org 336 | #+END_EXAMPLE 337 | 338 | Programa la publicación 339 | 340 | #+BEGIN_EXAMPLE 341 | org-bash-blog -p 342 | #+END_EXAMPLE 343 | 344 | NOVEDADES 345 | 346 | - Programar los días y horas de las publicaciones 347 | - Menú para generar el post 348 | - Muestra de forma gráfica en un calendario los dias de publicación 349 | - Añade buscador de artículos 350 | - Auto rellena el nombre de la página html, la descripción del post, ... 351 | - Descarga imágenes para incrustarlas en el artículos de imágenes en la web 352 | - Muestra el número de palabras y tiempo de lectura 353 | - Genera páginas relacionadas por categorías 354 | - Instalación de paquetes necesarios y autoconfiguración 355 | - Importanción desde archivos markdown⏎ 356 | 357 | 358 | Angel 359 | 360 | https://ugeek.github.io 361 | 362 | ugeekpodcast@gmail.com 363 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal 2 | google_analytics: UA-131560140-1 3 | -------------------------------------------------------------------------------- /blog.org: -------------------------------------------------------------------------------- 1 | #+TITLE: uGeek - Blog de Tecnología 2 | #+LINK: https://ugeek.github.io/blog 3 | #+DESCRIPTION: Blog de Tecnología, Android, GNU Linux, Servidores, y mucho más. Blog vinculado al Blog del Podcast de uGeek 4 | #+KEYWORDS: GNU, linux, Raspberry, android, domótica 5 | #+AUTHOR: Angel 6 | #+LANGUAGE: es 7 | #+STARTUP: inlineimages 8 | * TODO Eliminar líneas en Blanco con sed 9 | :PROPERTIES: 10 | :TITLE: Eliminar líneas en Blanco con sed 11 | :EXPORT_FILE_NAME: eliminar-lineas-en-blanco 12 | :DESCRIPTION: Como podemos eliminar líneas en Blanco 13 | :EXPORT_DATE: 2018-12-27 14 | :IMAGE: ./images/images-blog.png 15 | :CATEGORY: unix 16 | :TAG: bash,unix,terminal,sed 17 | :END: 18 | 19 | Para eliminar líneas en Blanco de un archivo de texto, podriamos utilizar *sed*. 20 | 21 | [[./images-blog/sed.png]] 22 | 23 | 24 | =cat archivo | sed '/^ *$/d' > nuevo_archivo= 25 | -------------------------------------------------------------------------------- /config: -------------------------------------------------------------------------------- 1 | # BROWSER 2 | BROWSER="firefox" # Browser to open page 3 | EMACS="emacs" # txt editor 4 | TWITTER="@ugeekpodcast" # nick twitter 5 | LANGUAGE="es_ES" 6 | GOOGLE_ANALITYCS="UA-131560140-1" 7 | 8 | # RSS 9 | LOGO_FEED="https://ugeek.github.io/ugeek.png" 10 | ICON="https://ugeek.github.io/icon/ugeek-256x256.png" 11 | IMAGE="https://ugeek.github.io/icon/ugeek.png" 12 | LANGUAGE_RSS="es" 13 | 14 | # HEAD PAGE PREVIEW 15 | HEAD=$(echo ' 16 | $TITLEPROGRAM 17 | 18 | 19 | 20 |








21 | ') 22 | 23 | # HEAD PAGE INDEX, LIST, TAG 24 | HEAD_PAGE=$(echo ' 25 | 26 | 27 | 28 | 29 |
30 | podcast   31 |    32 | GitHub   33 |    34 | Twitter   35 | Telegram
36 | 37 | ') 41 | 42 | # HEAD POST PAGE 43 | HEAD_PAGE_POST=$(echo ' 44 | 45 | 46 | 47 | 48 |
49 | podcast   50 |    51 | GitHub   52 |    53 | Twitter   54 | Telegram
55 | 56 | ') 60 | 61 | # MAIN CONTENT. INDEX PAGE 62 | INDEX=$(echo "Bienvenido al Blog del Podcast de *uGeek*. Aquí encontraras tutoriales y notas que voy tomando en el proceso de aprendizaje de todo aquello que os explico en el [[https://ugeek.github.io][Podcast]]. En la sección [[https://ugeek.github.io/tags.html][Tags]], encontraras todos los Artículos y Podcast, clasificados por temáticas.") 63 | 64 | # MAIN CONTENT. INDEX PAGE 65 | ULTIMO_TITULO_PODCAST=$(wget -q -O- "http://feeds.feedburner.com/ugeek" | grep '' | head -3 | tail -1 | sed 's/<title>/ /g' | sed 's/<\/title>/ /g') 66 | ULTIMO_PODCAST=$(wget -q -O- "http://feeds.feedburner.com/ugeek" | grep -o '<enclosure url="[^"]*' | grep -o '[^"]*$' | head -1) 67 | 68 | # MAIN CONTENT NEXT. INDEX PAGE 69 | INDEX_NEXT=$(echo " 70 | * $ULTIMO_TITULO_PODCAST 71 | #+HTML: <audio controls=''><source src="$ULTIMO_PODCAST" />Tu navegador no soporta reproductor de Podcast.</audio>") 72 | 73 | #+html:<h4><center> </center></h4><br> 74 | "$(cat /home/angel/blog/categories.org)" 75 | ") 76 | 77 | 78 | 79 | 80 | # FOOTER WEB. ALL PAGES 81 | PIE_WEB=$(echo '<p style="text-align: center;"><a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="license"><img style="border-width: 0px; display: block; margin-left: auto; margin-right: auto;" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" alt="Licencia de Creative Commons" /></a><br />Este obra está bajo una <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="license">licencia de Creative Commons Reconocimiento-NoComercial-CompartirIgual 4.0 Internacional</a>.</p><br><br><br>') 82 | 83 | 84 | 85 | 86 | ################################################################################################################# 87 | #POST PUBLICATION PROGRAMMING 88 | ################################################################################################################# 89 | 90 | # POST PROGRAM SCHEDULE 91 | PROGRAMS_ORG="/home/angel/blog/program/program.org" 92 | 93 | # DRAFT POST 94 | DRAFT_ORG="/home/angel/blog/program/draft.org" 95 | 96 | # BLOG FILE 97 | BLOG_ORG="/home/angel/blog/blog.org" 98 | 99 | # BLOG FOLDER 100 | PATH_BLOG="/home/angel/blog/" 101 | 102 | # ORG-BASH-BLOG 103 | ORG_BASH_BLOG="/usr/bin/org-bash-blog" 104 | 105 | # CONFIG FILES 106 | PATH_SCRIPTS_PROGRAMS="$HOME/.config/org-bash-blog/" 107 | 108 | # PUBLISH METHOD (Put the method of publication you use. Here is a post using git. If you don't want to post, don't put anything) 109 | PUBLISH="git add $PATH_BLOG . ; git commit -m 'publish post' ; git push ; curl -X POST https://api.telegram.org/bot<TOKEN>/sendMessage\?chat_id\=<YOUR ID>\&text\='Publicado Nuevo Post'" 110 | -------------------------------------------------------------------------------- /css/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* adaptar la imagen a la anchura de la pantalla */ 2 | img { 3 | max-width: 100%; 4 | 5 | } 6 | 7 | 8 | /* Letras centrales de uGeek */ 9 | 10 | #ugeek { 11 | position: absolute; 12 | font-size: 2.00em; 13 | top: 1.30em; } 14 | 15 | @media all and (min-width: 1000px){ 16 | #ugeek { left: 42%; } } 17 | 18 | 19 | 20 | body { 21 | font-family: "Lato"; 22 | font-size: 19px; , Lato; } 23 | 24 | @media all and (min-width: 1000px){ 25 | body { 26 | max-width: 80%; 27 | margin: auto; } } 28 | 29 | @media all and (max-width: 1000px){ 30 | body { margin: 1em; } } 31 | 32 | 33 | #logo img { 34 | border-radius: 10px; 35 | border-color: white; 36 | position: absolute; 37 | font-size: 1.50em; 38 | top: 1.00em; } 39 | 40 | 41 | @media all and (min-width: 1000px){ 42 | #logo { left: 10%; } } 43 | 44 | @media all and (max-width: 1000px){ 45 | #logo { left: 10%; } } 46 | 47 | 48 | 49 | @media all and (min-width: 1000px){ 50 | #me { left: 10%; } } 51 | 52 | @media all and (max-width: 1000px){ 53 | #me { left: 1em; } } 54 | 55 | 56 | 57 | 58 | /* Artículos Podcast Tags */ 59 | 60 | #menu { 61 | position: absolute; 62 | font-size: 1.200em; 63 | top: 7.525em; } 64 | 65 | @media all and (min-width: 1000px){ 66 | #menu { left: 10%; } } 67 | 68 | @media all and (max-width: 1000px){ 69 | #menu { left: 1em; } } 70 | 71 | 72 | #name { 73 | position: absolute; 74 | top: 1.50em; } 75 | 76 | @media all and (min-width: 1000px){ 77 | #name { right: 10%; } } 78 | 79 | @media all and (max-width: 1000px){ 80 | #name { right: 1em; } } 81 | 82 | 83 | 84 | @media all and (min-width: 1000px){ 85 | #icon { right: 10%; } } 86 | 87 | @media all and (max-width: 1000px){ 88 | #icon { right: 1em; } } 89 | 90 | 91 | 92 | .title { 93 | text-align: left; 94 | margin-left: 10px; 95 | border-bottom-style: solid; 96 | border-bottom-color: lightgray; } 97 | 98 | #table-of-contents { 99 | margin-left: 10px; } 100 | #table-of-contents h2 { 101 | margin-left: 20px; 102 | display: none; } 103 | #table-of-contents ul { 104 | list-style-type: none; 105 | margin-left: 0; 106 | padding-left: 0; } 107 | 108 | #outline-container-orgheadline2 li { 109 | margin: 1em; 110 | list-style-type: none; } 111 | 112 | 113 | h1 { 114 | color: #3c1b66; 115 | 116 | font-weight: normal; 117 | font-size: 32px; 118 | font-family: Arial; 119 | text-transform: uppercase; 120 | border-bottom-style: solid; 121 | border-bottom-color: lightgray; 122 | } 123 | h2 { 124 | color: #6c2eb9; 125 | font-weight: normal; 126 | font-size: 30px; 127 | font-family: Arial; 128 | border-bottom-style: solid; 129 | border-bottom-color: lightgray; 130 | } 131 | h3 { 132 | color: #443963; 133 | font-weight: normal; 134 | font-size: 25px; 135 | font-family: Arial; 136 | border-bottom-style: solid; 137 | border-bottom-color: lightgray; 138 | } 139 | h4 { 140 | color: #4f4866; 141 | font-weight: normal; 142 | font-size: 20px; 143 | font-family: Arial; 144 | border-bottom-style: solid; 145 | border-bottom-color: lightgray; 146 | } 147 | h5 { 148 | color: #656172; 149 | font-weight: normal; 150 | font-size: 18px; 151 | font-family: Arial; 152 | border-bottom-style: solid; 153 | border-bottom-color: lightgray; 154 | } 155 | h6 { 156 | color: #747377; 157 | font-weight: normal; 158 | font-size: 18px; 159 | font-family: Arial; 160 | border-bottom-style: solid; 161 | border-bottom-color: lightgray; 162 | } 163 | 164 | a { 165 | text-decoration: none; 166 | color: #4a708b; } 167 | 168 | a:hover { 169 | text-decoration: underline; } 170 | 171 | .img-link a { 172 | color: white; } 173 | 174 | blockquote { 175 | border-left: 1px solid gray; 176 | padding-left: 4px; } 177 | 178 | #doc-info { 179 | margin-top: 3em; 180 | margin: auto; 181 | float: center; 182 | text-align: center; 183 | font-size: 8pt; 184 | max-width: 75%; } 185 | 186 | 187 | 188 | code { 189 | background-color: #f3e8fb; 190 | border: 0px solid #a8a9ba; 191 | color: #000000; 192 | font-family: monospace; 193 | /* font-size: 0.93em; */ 194 | margin: 25px 0px; 195 | padding: 0px 2px; } 196 | 197 | 198 | 199 | 200 | pre { 201 | background-color: #f3e8fb; 202 | border: 1px solid #a8a9ba; 203 | color: #000000; 204 | font-family: monospace; 205 | line-height: 1.14em; 206 | overflow: auto; 207 | /* overflow-x: auto; */ 208 | padding: 10px; 209 | margin: 25px 1px; } 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | table th { 227 | font:bold 15px Arial; 228 | background-color:#a4a5a5; 229 | text-indent: 10px; 230 | color : black; 231 | } 232 | 233 | 234 | 235 | table { 236 | width:70%; 237 | font:normal 15px Verdana; 238 | text-align:center; 239 | border-collapse:collapse; 240 | } 241 | 242 | 243 | 244 | /*table.negative td[negative^="-"] {color:red;} 245 | td.negative { color : red; } */ 246 | 247 | 248 | table, th, td { 249 | border: 1px solid black; 250 | margin: auto; 251 | } 252 | 253 | 254 | 255 | 256 | 257 | /* Una fila de cada color */ 258 | 259 | tr:nth-child(odd) { 260 | 261 | background-color:#f2f2f2; 262 | 263 | } 264 | 265 | tr:nth-child(even) { 266 | 267 | background-color:#d9dcde; 268 | 269 | } 270 | 271 | /* Cambiar de color al pasar el ratón por las filas */ 272 | 273 | tr:hover { 274 | background-color: #abb9b0; 275 | } 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | #icon { 286 | position: absolute; 287 | font-size: 0.8625em; 288 | top: 6.125em; } 289 | 290 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.md 3 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | Cree un blog a partir de un único archivo en orgmode, con toda la potencia de bash. 2 | 3 | Conservando el archivo blog.org, con la totalidad del contenido del blog en texto plano y org-bash-blog, en cualquier lugar puedes levantar el blog en segundos. 4 | 5 | Ventajas respecto a otro tipo de blogs y objetivos 6 | -------------------------------------------------- 7 | 8 | * Aprovechando las ventajas del formato y sintaxis orgmode, tener todo el blog en un único archivo de texto plano, y a partir de este, con un solo clic levantar un blog estático HTML ultraligero y sin base de datos, en cualquier tipo de servidor web o local. 9 | * Poder ir redactando tus artículos y programarlos para que se publiquen automáticamente 10 | * Depositar en la carpeta **org**, archivos .org independientes con el nombre de la categoría y con todos los artículos de esa categoría. 11 | * Si te gusta Markdown, también puedes crear tus artículos en Markdown e importarlos con Org-Bash-Blog 12 | 13 | Características del Blog 14 | ------------------------ 15 | 16 | - Genera el RSS del blog y RSS por categorías 17 | - Genera página Home, con los cinco últimos artículos publicados 18 | - Genera página con un índice de la totalidad de los artículos publicados, ordenados por fecha 19 | - Genera página ordenada tags, de un modo inteligente 20 | - En cada artículo, sugerencia a otro post de la misma categoría 21 | - Poder utilizar Google Analytics o similar 22 | - Añadir fecha de modificación de un artículo 23 | - Programación de publicación de Post 24 | - Publicación mediante git 25 | - Utiliza sintaxis orgmode, podiendo añadir imágenes, tablas, cajetillas de código… 26 | - También puedes importar artículos en markdown 27 | 28 | Ventajas respecto a otro tipo de blogs y objetivos 29 | -------------------------------------------------- 30 | 31 | * Aprovechando las ventajas del formato y sintaxis orgmode, tener todo el blog en un único archivo de texto plano, y a partir de este, con un solo clic levantar un blog estático HTML ultraligero para cualquier tipo de servidor web (conservando el archivo blog.org, con la totalidad del contenido del blog en texto plano y Org-Bash-Blog, en cualquier lugar puedes levantar el blog) 32 | * Poder ir redactando tus artículos y programarlos para que se publiquen automáticamente 33 | * Depositar en la carpeta **org**, archivos .org independientes con el nombre de la categoría y con todos los post de esa categoría. 34 | 35 | Instalación 36 | ----------- 37 | 38 | Clonaremos el repositorio de Org-Bash-Blog 39 | 40 | git clone https://github.com/uGeek/org-bash-blog.git ; cd org-bash-blog 41 | 42 | Instalaremos Org-Bash-Blog en nuestro sistema, actualizaremos la ruta de configuración e intalaremos todos los paquetes necesarios. 43 | 44 | sudo ./org-bash-blog -i 45 | 46 | Paquetes necesarios 47 | ------------------- 48 | 49 | Para el correcto funcionamiento de Org-Bash-Blog, necesitamos instalar los siguientes paquetes. Si has instalado Org-Bash-Blog en tu sistema, no será necesario. 50 | 51 | sudo apt install bash pandoc xml2 wget bc whiptail 52 | 53 | Instalar Calcurse si deseas ver los días de publicación de forma gráfica 54 | 55 | sudo apt install calcurse 56 | 57 | Si vas a hospedar tu blog en GitHub, GitLab,… Necesitarás también git 58 | 59 | sudo apt install git 60 | 61 | Ostras Distribuciones no derivadas de Debian 62 | -------------------------------------------- 63 | 64 | Si utilizas distribuciones no derivadas de Debian, Org-Bash-Blog funcionará perfectamente, pero es necesario instalar los paquetes: 65 | 66 | * bash 67 | * pandoc 68 | * xml2 69 | * wget 70 | * bc 71 | * whiptail 72 | * calcurse 73 | * git 74 | 75 | Creando la configuración del Blog 76 | --------------------------------- 77 | 78 | Situados en el directorio donde vamos a construir el blog, donde hemos clonado el repositorio de Org-Bash-Blog y están los archivos **config** y **org-bash-blog**, ejecutaremos el siguiente comando: 79 | 80 | sudo ./org-bash-blog -i 81 | 82 | Esto editará de forma automática la ruta del archivo de configuración y configurará la ruta del blog en el archivo de configuración. 83 | 84 | Puedes cambiar la ruta del archivo de configuración donde desees 85 | 86 | ### Configuración manual 87 | 88 | Abre con tu editor de texto favorito el archivo _**org-bash-blo**_**g** y busca en las primeras líneas, donde aparece **source.** 89 | 90 | Escribe la ruta completa donde está el archivo **config.** Podrías dejarlo dentro de la misma carpeta, pero no es obligatorio. 91 | 92 | Edita el archivo **config**, añadiendo todas aquellas variables que aparecen, como la ruta de la carpeta del blog, editor de texto, navegador, etc … 93 | 94 | Creando estructura de directorios y el archivo blog.org 95 | ------------------------------------------------------- 96 | 97 | ### Creando estructura de directorios 98 | 99 | En el caso que no hubieras clonado el repositorio, este comando creará toda la estructura de directorios 100 | 101 | org-bash-blog -b 102 | 103 | ### Creando archivo blog.org 104 | 105 | En el archivo blog.org, estará todo el contenido del blog. Vamos a crearlo. Si h 106 | 107 | org-bash-blog -f blog.org 108 | 109 | En cabecera del archivo **blog.org**, añade el Título del blog, url del blog, Descripción, Palabras clave del blog y autor. 110 | 111 | #+TITLE: Título 112 | #+LINK: https://miblog.org 113 | #+DESCRIPTION: Este es mi nuevo blog 114 | #+KEYWORDS: personal, notas 115 | #+AUTHOR: angel 116 | 117 | Archivo program.org y draft.org 118 | ------------------------------- 119 | 120 | * **draft.org**, es una archivo donde iremos creando artículos para un futuro o artículos en sucio. 121 | * **program.org**, es el archivo donde importaremos los artículos de **draft.org**, podremos **previsualizarlos** en formato .html en nuestro navegador antes de su publicación, añadirá las descripción del artículo para ser publicado en el feed y quedará aquí a la espera programado, esperando el dia y hora de su publicación. 122 | 123 | Tanto el archivo **draft.org** como **program.org**, no necesitan la cabecera en la parte superior como el archivo **blog.org.** 124 | 125 | **El único requisito importante, todos los Artículos tanto en el archivo blog.org y program.org, tienen que estar en estado TODO** 126 | 127 | Vamos a crear los archivos **draft.org** y **program.org.** Entraremos en el directorio `/program` y crearemos los archivos: 128 | 129 | cd program/ ; touch draft.org program.org 130 | 131 | Creando el Primer Artículo 132 | -------------------------- 133 | 134 | Para crear un artículo, es tan sencillo como escribir en tu terminal: 135 | 136 | org-bash-blog -n 137 | 138 | **Org-bash-blog** nos hará una serie de preguntas sobre el Artículo a que vamos a crear, como: 139 | 140 | * Título 141 | * Categoria 142 | * Etiquetas 143 | * Nombre de la imagen de referencia en el Post. Ejemplo imagen.jpg 144 | * La url de esta imagen, si está en un servidor. **Org-bash-blog** descargará la imagen en el directorio `**images-blog/**` y la renombrara con el nombre de imagen que le hemos dado 145 | 146 | Si hemos seleccionado **Emacs** como editor de texto, abrirá **Emacs** con el archivo **draft.org.** 147 | 148 | En la cabecera, aparecerá la fecha y hora actual, como ejemplo. 149 | 150 | **No es necesario añadir la descripción, ya que org-bash-blog lo creará después de forma automática** 151 | 152 | Importación desde archivos markdown 153 | ----------------------------------- 154 | 155 | Si has utilizado otro editor externo y has creado el artículo en un archivo markdown, puedes importarlo a Org-Bash-Blog. Estén donde estén esos archivos ejecuta: 156 | 157 | org-bash-blog -nim archivo.md 158 | 159 | Previsualizando el Artículo 160 | --------------------------- 161 | 162 | Para previsualizar el artículo que hemos creado, tenemos que pasar este del archivo **draft.org** a **program.org**. Para ello tenemos que poner el artículo o artículos que queremos pasar a **program.org** en estado `PROGRAM`. Una vez hayamos especificado este estado, teclearemos el comando: 163 | 164 | org-bash-blog -d 165 | 166 | Esto enviará todos los archivos de **draft.org** con estado `PROGRAM` al archivo program.org 167 | 168 | En **draft.org**, todos los archivos enviados a **program.org**, no serán borrados, permanecerán en **draft.org** pero pasarán al estado **DONE**. 169 | 170 | Previsualizar los Artículos 171 | --------------------------- 172 | 173 | Para generar archivos html y ver una vista previa de los artículos que están en el archivo **program.org**, utilizaremos la opción **\-w** seguido del archivo **program.org** 174 | 175 | org-bash-blog -w program.org 176 | 177 | * Al salir de la previsualización, **org-bash-blog habrá rellenado la Descripción del Post con las primeras 30 palabras del artículo** 178 | * Creará una página índice con todos los enlaces a las páginas generadas para la previsualización. 179 | * Estás páginas serán eliminadas cuando utilicemos la opción **\-p** para programar el artículos. 180 | 181 | Programar Artículos 182 | ------------------- 183 | 184 | Utilizando la opción **\-p**, todos los artículos que estén en **program.org**, serán programados con la fecha y hora que indican. 185 | 186 | **Es necesario estar dentro del directorio donde está el archivo program.org para programarlo**. 187 | 188 | org-bash-blog -p 189 | 190 | Si la carpeta contenía archivos html de la previsualización anterior, serán eliminados. 191 | 192 | Para ver los Artículos que tenemos programados, utilizaremos la opción **\-h** de ayuda. En la parte inferior de la ayuda aparecen todos los archivos programados con su título, fecha y hora. 193 | 194 | org-bash-blog -h 195 | 196 | Cuando llegue la fecha y hora, el Artículo programado, org-bash-blog pasará el artículo programado del archivo **program.org** al archivo **blog.org**. 197 | 198 | **Cada vez que modifiques el archivo program.org o modifiques una fecha de publicación, tienes que ejecutar** `org-bash-blog -p` **para que org-bash-blog los ordene por fecha para la publicación.** 199 | 200 | org-bash-blog -p 201 | 202 | Calendario de Publicaciones 203 | --------------------------- 204 | 205 | Si deseas ver la programación de los artículos programados mediante un calendario, ejecuta: 206 | 207 | org-bash-blog -cal 208 | 209 | Org-Bash-Blog abrirá calcurse y verás los días programados en el calendario con el título seguido de # org-bash-blog 210 | 211 | Publicación manual o modificación de Artículo 212 | --------------------------------------------- 213 | 214 | Si queremos modificar o eliminar algún artículo publicado, lo haremos en el archivo **blog.org**. 215 | 216 | Para que el cambio ejecutar este cambio 217 | 218 | org-bash-blog blog.org 219 | 220 | **Org-bash-blog** creará todas las páginas .html, index.html, list.html, tag.html y el archivo feed.xml 221 | 222 | Publicación en GitHub, GitLab,… 223 | ------------------------------- 224 | 225 | Si tu blog está en repositorio tipo git, puedes hacer un git push desde cualquier directorio con: 226 | 227 | org-bash-blog -g 228 | 229 | Editar draft 230 | ------------ 231 | 232 | Abre el archivo **draft.org** con emacs en modo gráfico. 233 | 234 | org-bash-blog draft 235 | 236 | Abre el archivo **draft.org** con emacs en modo terminal 237 | 238 | org-bash-blog draftt 239 | 240 | Editar program 241 | -------------- 242 | 243 | Abre el archivo **program.org** con emacs en modo gráfico. 244 | 245 | org-bash-blog program 246 | 247 | Abre el archivo **program.org** con emacs en modo terminal 248 | 249 | org-bash-blog programt 250 | 251 | Editar blog 252 | ----------- 253 | 254 | Abre el archivo **blog.org** con emacs en modo gráfico. 255 | 256 | org-bash-blog blog 257 | 258 | Abre el archivo **blog.org** con emacs en modo terminal 259 | 260 | org-bash-blog blogt 261 | 262 | Resumen del proceso, creación, programación, publicación de un Artículo 263 | ----------------------------------------------------------------------- 264 | 265 | draft -> program -> blog 266 | 267 | Crea un nuevo artículo en draft 268 | 269 | org-bash-blog -n 270 | 271 | Si lo quieres importar desde un archivo markdown 272 | 273 | org-bash-blog -nim archivo.md 274 | 275 | Para enviar artículos de draft.org a program.org, cambiamos del estado **TODO** A **PROGRAM** y ejecutamos el comando: 276 | 277 | org-bash-blog -d 278 | 279 | Para previsualizarlo y que org-bash-blog añada la descripción del artículo para el feed: 280 | 281 | org-bash-blog -w programa.org 282 | 283 | Programa la publicación 284 | 285 | org-bash-blog -p 286 | 287 | NOVEDADES 288 | 289 | * Programar los días y horas de las publicaciones 290 | * Menú para generar el post 291 | * Muestra de forma gráfica en un calendario los dias de publicación 292 | * Añade buscador de artículos 293 | * Auto rellena el nombre de la página html, la descripción del post, ... 294 | * Descarga imágenes para incrustarlas en el artículos de imágenes en la web 295 | * Muestra el número de palabras y tiempo de lectura 296 | * Genera páginas relacionadas por categorías 297 | * Instalación de paquetes necesarios y autoconfiguración 298 | * Importanción desde archivos markdown -------------------------------------------------------------------------------- /doc/guia_castellano.md: -------------------------------------------------------------------------------- 1 | # Org-bash-blog 2 | Cree un blog a partir de un único archivo en orgmode con emacs y con toda la potencia de bash 3 | 4 | ## Requisitos 5 | 6 | Linux y tener instalada emacs26 o superior. 7 | 8 | ## Características del Blog 9 | 10 | - Genera el RSS del blog y RSS por categorías 11 | - Genera página Home, con los cinco últimos artículos publicados 12 | - Genera página con un índice de la totalidad de los artículos publicados, ordenados por fecha 13 | - Genera página ordenada tags, de un modo inteligente 14 | - En cada artículo, sugerencia a otro post de la misma categoría 15 | - Poder utilizar Google Analytics o similar 16 | - Añadir fecha de modificación de un artículo 17 | - Utilizar sintaxis orgmode y poder añadir imágenes, tablas, cajetillas de código… 18 | 19 | ## Blogs que utilizan org-bash-blog 20 | 21 | - <https://ugeek.github.io/blog> 22 | - <https://elblogdelazaro.gitlab.io> 23 | - <https://www.quijotelibre.com> 24 | 25 | Si creas tu blog con org-bash-blog, envíame un correo para añadirte a la lista. 26 | 27 | ## Ventajas respecto a otro tipo de blogs y objetivos 28 | 29 | - Aprovechando las ventajas del formato y sintaxis orgmode, tener todo el blog en un único archivo de texto plano, y a partir de este, con un solo clic levantar un blog estático HTML ultraligero para cualquier tipo de servidor web( conservando el archivo blog.org, con la totalidad del contenido del blog en texto plano y org-bash-blog.sh, en cualquier lugar puedes levantar el blog) 30 | - Poder ir redactando tus artículos en el mismo blog.org y sólo cambiando el estado a TODO, publicar este artículo. 31 | - Depositar en la carpeta org, archivos .org independientes con el nombre de la categoría y con todos los post de esta categoría dentro de este archivo, al generar el blog. 32 | 33 | ## Creando Artículos 34 | 35 | Después de crear la cabecera del orgmode, añadiremos las :PROPERTIES: (no dejar una línea en blanco de separación), dónde está toda la información que posteriormente será exportada tanto al artículo como al RSS. 36 | ``` 37 | :PROPERTIES: 38 | :TITLE: Titulo del artículo 39 | :EXPORT_FILE_NAME: nombre del fichero html 40 | :DESCRIPTION: Pequeña descripción del artículo 41 | :EXPORT_DATE: Fecha, que servira como emcabezado para el fichero html 42 | :CATEGORY: categoria con la que vas a agrupar los articulos 43 | :TAG: etiquetas del articulo 44 | :END: 45 | ``` 46 | - :TITLE: Título del post 47 | - :EXPORT_FILE_NAME: será el nombre de la página html, así que no incluir símbolos extraños. org-bash-blog añadirá un guión entre espacios y eliminará acentos en el caso de haberlos 48 | - :DESCRIPTION: Una descripción breve del artículo que saldrá impresa en el RSS. La descripción tiene que estar en una única línea, si no, dará error. 49 | - :EXPORT_DATE: añadir la fecha de publicación y ahora, con el siguiente formato: 50 | 51 | ```:EXPORT_DATE: 20190125 14:00``` 52 | 53 | La fecha de publicación sería el 25 de enero del 2019 a las 14 horas 54 | 55 | Si con el tiempo queremos modificar un artículo y que quede constancia en el post, añadiremos la fecha de la siguiente manera: 56 | 57 | ```:EXPORT_DATE: 20190125 14:00 20190214``` 58 | 59 | La fecha de modificación del artículo será el 14 de febrero de 2019 60 | 61 | - :CATEGORY: tiene que ser solo una palabra y englobar la categoría general. Los artículos relacionados que aparecen a pie de página en cada artículo, los relaciona en función de la categoría. También en la carpeta org, dejará un archivo o orgmode por cada categoría con todos los post de esta misma. 62 | - :TAG: puede ser una o varias palabras separadas por comas. No importa si hay espacio entre comas. Hay que tener en cuenta que cada palabra nueva que crees en cualquier artículo, se creara un nueva TAG en página de tags. Cada vez que ejecutemos org-bash-blog, utilizará todas las tags creadas en todos los post y buscará en todos los artículos dentro de sus :PROPERTIES:, si aparece esa palabra, la añadirá en el grupo de artículos vinculados a esa TAG. 63 | 64 | ## Publicar 65 | 66 | Para publicar un post, tenemos que cambiar el estado del post creado en blog.org a TODO. 67 | 68 | EL archivo **TODO a publicar**, siempre tiene que estar el último en la lista de artículos del blog.org. 69 | 70 | Puedes dejar todos los estados en TODO, para volver a crear todos los archivos html. De esta manera, las sugerencias con otras páginas relacionadas de la misma categoría se actualizarán. 71 | 72 | ## Importante para el correcto funcionamiento 73 | 74 | Cosas a tener e cuenta para el buen funcionamiento de org-bash-blog 75 | 76 | - Las 20 primeras líneas, quedan reservadas para código de exportación HTML(Google analítics, metadatos,…) 77 | - El archivo o orgmode, siempre debe llamarse blog.org 78 | - No intercalar post en estado TODO, porque dará error. Todos los post con estado TODO, deben estar en la parte final de la página. 79 | - No añadir las :PROPERTIES: del post, hasta el momento de publicar. El feed se genera a partir de las :PROPERTIES: 80 | - no utilizar el carácter | en el título del post no las :PROPERTIES: 81 | 82 | ## Estética del Blog 83 | 84 | Utiliza un css para personalizar la tipografía y diseño del blog. Después de crear el blog, podremos cambiar esa tipografía, y diseño. 85 | 86 | # Configuración 87 | 88 | - blog.org 89 | - org-bash-blog.sh 90 | 91 | ## blog.org 92 | 93 | Siempre el nombre del archivo tiene que ser blog.org. 94 | ``` 95 | #+TITLE: uGeek - Blog de Tecnología 96 | #+LINK: https://ugeek.github.io/blog 97 | #+DESCRIPTION: Blog de Tecnología, Android, GNU Linux, Servidores, y mucho más. Blog vinculado al Blog del Podcast de uGeek 98 | #+KEYWORDS: GNU, linux, Raspberry, android, domótica 99 | #+AUTHOR: Angel 100 | #+LANGUAGE: es 101 | ``` 102 | 103 | 104 | 105 | Estos parámetros son muy importantes, ya que son los valores que aparecerán en el feed, así como el nombre de los links de las páginas webs. 106 | 107 | La cabecera del archivo blog.org, incluye: 108 | 109 | - \#+TITLE: Título del blog que aparecerá en el título de cada 110 | 111 | página generada así como en el feed o rss 112 | 113 | - \#+LINK: Enlace raíz donde irá hospedado el blog. A partir de este dato, org-bash-blog creará todos los enlaces de los artículos 114 | - \#+DESCRIPTION: Descripción del blog incluida en el rss 115 | - \#+KEYWORDS: Palabras clave del blog. 116 | - \#+AUTHOR: Autor 117 | - \#+LANGUAGE: Idioma del blog 118 | 119 | Otros datos 120 | 121 | - \#+HTML_HEAD: Todo lo que se añada tras esta etiqueta, será código que se incluirá en cabecera del html, entre el <head> y </head>. Ejem: El código, va el código del css. 122 | - \#+HTML: Lo que escríbanos tras esta etiqueta, será código que será copiado en el cuerpo de la página html, entre las ètiquetas <body> </body> ejem: El código html del texto del menú, imagen del logo,…. 123 | 124 | También podríamos incluir en el post, mediante esta etiqueta, código embebido a lo largo de este, como vídeos de YouTube, imágenes de servidores, reproductores html, etc… 125 | 126 | ## org-bash-blog.sh 127 | 128 | - Texto de bienvenida que aparece en la parte superior de la página index.html 129 | 130 | ``` 131 | INDEX=$(echo "Bienvenidos al Blog de uGeek") 132 | ``` 133 | 134 | - Después, de forma automática, salen publicados los 5 últimos artículos publicados. 135 | 136 | 137 | - Texto que aparece en la parte central de la página. Página index.html 138 | 139 | ``` 140 | INDEX_NEXT=$(echo " ") 141 | ``` 142 | 143 | - .Texto o contenido que aparece antes del pie de página. Todas las páginas. 144 | 145 | ``` 146 | PIE_WEB= 147 | ``` 148 | 149 | - Logo que aparece 150 | 151 | ``` 152 | LOGO_FEED="ugeek.png" 153 | ``` 154 | 155 | - Añadir Google analítics o cualquier otro código que quieras añadir en todas las páginas generadas 156 | 157 | ``` 158 | GOOGLE_ANALITYCS= 159 | ``` 160 | 161 | 162 | 163 | 164 | 165 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | *.md 2 | *.html 3 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Cree un blog a partir de un único archivo en orgmode, con toda la potencia de bash. 2 | 3 | Conservando el archivo blog.org, con la totalidad del contenido del blog en texto plano y org-bash-blog, en cualquier lugar puedes levantar el blog en segundos. 4 | 5 | Ventajas respecto a otro tipo de blogs y objetivos 6 | -------------------------------------------------- 7 | 8 | * Aprovechando las ventajas del formato y sintaxis orgmode, tener todo el blog en un único archivo de texto plano, y a partir de este, con un solo clic levantar un blog estático HTML ultraligero y sin base de datos, en cualquier tipo de servidor web o local. 9 | * Poder ir redactando tus artículos y programarlos para que se publiquen automáticamente 10 | * Depositar en la carpeta **org**, archivos .org independientes con el nombre de la categoría y con todos los artículos de esa categoría. 11 | * Si te gusta Markdown, también puedes crear tus artículos en Markdown e importarlos con Org-Bash-Blog 12 | 13 | Características del Blog 14 | ------------------------ 15 | 16 | - Genera el RSS del blog y RSS por categorías 17 | - Genera página Home, con los cinco últimos artículos publicados 18 | - Genera página con un índice de la totalidad de los artículos publicados, ordenados por fecha 19 | - Genera página ordenada tags, de un modo inteligente 20 | - En cada artículo, sugerencia a otro post de la misma categoría 21 | - Poder utilizar Google Analytics o similar 22 | - Añadir fecha de modificación de un artículo 23 | - Programación de publicación de Post 24 | - Publicación mediante git 25 | - Utiliza sintaxis orgmode, podiendo añadir imágenes, tablas, cajetillas de código… 26 | - También puedes importar artículos en markdown 27 | 28 | Ventajas respecto a otro tipo de blogs y objetivos 29 | -------------------------------------------------- 30 | 31 | * Aprovechando las ventajas del formato y sintaxis orgmode, tener todo el blog en un único archivo de texto plano, y a partir de este, con un solo clic levantar un blog estático HTML ultraligero para cualquier tipo de servidor web (conservando el archivo blog.org, con la totalidad del contenido del blog en texto plano y Org-Bash-Blog, en cualquier lugar puedes levantar el blog) 32 | * Poder ir redactando tus artículos y programarlos para que se publiquen automáticamente 33 | * Depositar en la carpeta **org**, archivos .org independientes con el nombre de la categoría y con todos los post de esa categoría. 34 | 35 | Instalación 36 | ----------- 37 | 38 | Clonaremos el repositorio de Org-Bash-Blog 39 | 40 | git clone https://github.com/uGeek/org-bash-blog.git ; cd org-bash-blog 41 | 42 | Instalaremos Org-Bash-Blog en nuestro sistema, actualizaremos la ruta de configuración e intalaremos todos los paquetes necesarios. 43 | 44 | sudo ./org-bash-blog -i 45 | 46 | Paquetes necesarios 47 | ------------------- 48 | 49 | Para el correcto funcionamiento de Org-Bash-Blog, necesitamos instalar los siguientes paquetes. Si has instalado Org-Bash-Blog en tu sistema, no será necesario. 50 | 51 | sudo apt install bash pandoc xml2 wget bc whiptail 52 | 53 | Instalar Calcurse si deseas ver los días de publicación de forma gráfica 54 | 55 | sudo apt install calcurse 56 | 57 | Si vas a hospedar tu blog en GitHub, GitLab,… Necesitarás también git 58 | 59 | sudo apt install git 60 | 61 | Ostras Distribuciones no derivadas de Debian 62 | -------------------------------------------- 63 | 64 | Si utilizas distribuciones no derivadas de Debian, Org-Bash-Blog funcionará perfectamente, pero es necesario instalar los paquetes: 65 | 66 | * bash 67 | * pandoc 68 | * xml2 69 | * wget 70 | * bc 71 | * whiptail 72 | * calcurse 73 | * git 74 | 75 | Creando la configuración del Blog 76 | --------------------------------- 77 | 78 | Situados en el directorio donde vamos a construir el blog, donde hemos clonado el repositorio de Org-Bash-Blog y están los archivos **config** y **org-bash-blog**, ejecutaremos el siguiente comando: 79 | 80 | sudo ./org-bash-blog -i 81 | 82 | Esto editará de forma automática la ruta del archivo de configuración y configurará la ruta del blog en el archivo de configuración. 83 | 84 | Puedes cambiar la ruta del archivo de configuración donde desees 85 | 86 | ### Configuración manual 87 | 88 | Abre con tu editor de texto favorito el archivo _**org-bash-blo**_**g** y busca en las primeras líneas, donde aparece **source.** 89 | 90 | Escribe la ruta completa donde está el archivo **config.** Podrías dejarlo dentro de la misma carpeta, pero no es obligatorio. 91 | 92 | Edita el archivo **config**, añadiendo todas aquellas variables que aparecen, como la ruta de la carpeta del blog, editor de texto, navegador, etc … 93 | 94 | Creando estructura de directorios y el archivo blog.org 95 | ------------------------------------------------------- 96 | 97 | ### Creando estructura de directorios 98 | 99 | En el caso que no hubieras clonado el repositorio, este comando creará toda la estructura de directorios 100 | 101 | org-bash-blog -b 102 | 103 | ### Creando archivo blog.org 104 | 105 | En el archivo blog.org, estará todo el contenido del blog. Vamos a crearlo. Si h 106 | 107 | org-bash-blog -f blog.org 108 | 109 | En cabecera del archivo **blog.org**, añade el Título del blog, url del blog, Descripción, Palabras clave del blog y autor. 110 | 111 | #+TITLE: Título 112 | #+LINK: https://miblog.org 113 | #+DESCRIPTION: Este es mi nuevo blog 114 | #+KEYWORDS: personal, notas 115 | #+AUTHOR: angel 116 | 117 | Archivo program.org y draft.org 118 | ------------------------------- 119 | 120 | * **draft.org**, es una archivo donde iremos creando artículos para un futuro o artículos en sucio. 121 | * **program.org**, es el archivo donde importaremos los artículos de **draft.org**, podremos **previsualizarlos** en formato .html en nuestro navegador antes de su publicación, añadirá las descripción del artículo para ser publicado en el feed y quedará aquí a la espera programado, esperando el dia y hora de su publicación. 122 | 123 | Tanto el archivo **draft.org** como **program.org**, no necesitan la cabecera en la parte superior como el archivo **blog.org.** 124 | 125 | **El único requisito importante, todos los Artículos tanto en el archivo blog.org y program.org, tienen que estar en estado TODO** 126 | 127 | Vamos a crear los archivos **draft.org** y **program.org.** Entraremos en el directorio `/program` y crearemos los archivos: 128 | 129 | cd program/ ; touch draft.org program.org 130 | 131 | Creando el Primer Artículo 132 | -------------------------- 133 | 134 | Para crear un artículo, es tan sencillo como escribir en tu terminal: 135 | 136 | org-bash-blog -n 137 | 138 | **Org-bash-blog** nos hará una serie de preguntas sobre el Artículo a que vamos a crear, como: 139 | 140 | * Título 141 | * Categoria 142 | * Etiquetas 143 | * Nombre de la imagen de referencia en el Post. Ejemplo imagen.jpg 144 | * La url de esta imagen, si está en un servidor. **Org-bash-blog** descargará la imagen en el directorio `**images-blog/**` y la renombrara con el nombre de imagen que le hemos dado 145 | 146 | Si hemos seleccionado **Emacs** como editor de texto, abrirá **Emacs** con el archivo **draft.org.** 147 | 148 | En la cabecera, aparecerá la fecha y hora actual, como ejemplo. 149 | 150 | **No es necesario añadir la descripción, ya que org-bash-blog lo creará después de forma automática** 151 | 152 | Importación desde archivos markdown 153 | ----------------------------------- 154 | 155 | Si has utilizado otro editor externo y has creado el artículo en un archivo markdown, puedes importarlo a Org-Bash-Blog. Estén donde estén esos archivos ejecuta: 156 | 157 | org-bash-blog -nim archivo.md 158 | 159 | Previsualizando el Artículo 160 | --------------------------- 161 | 162 | Para previsualizar el artículo que hemos creado, tenemos que pasar este del archivo **draft.org** a **program.org**. Para ello tenemos que poner el artículo o artículos que queremos pasar a **program.org** en estado `PROGRAM`. Una vez hayamos especificado este estado, teclearemos el comando: 163 | 164 | org-bash-blog -d 165 | 166 | Esto enviará todos los archivos de **draft.org** con estado `PROGRAM` al archivo program.org 167 | 168 | En **draft.org**, todos los archivos enviados a **program.org**, no serán borrados, permanecerán en **draft.org** pero pasarán al estado **DONE**. 169 | 170 | Previsualizar los Artículos 171 | --------------------------- 172 | 173 | Para generar archivos html y ver una vista previa de los artículos que están en el archivo **program.org**, utilizaremos la opción **\-w** seguido del archivo **program.org** 174 | 175 | org-bash-blog -w program.org 176 | 177 | * Al salir de la previsualización, **org-bash-blog habrá rellenado la Descripción del Post con las primeras 30 palabras del artículo** 178 | * Creará una página índice con todos los enlaces a las páginas generadas para la previsualización. 179 | * Estás páginas serán eliminadas cuando utilicemos la opción **\-p** para programar el artículos. 180 | 181 | Programar Artículos 182 | ------------------- 183 | 184 | Utilizando la opción **\-p**, todos los artículos que estén en **program.org**, serán programados con la fecha y hora que indican. 185 | 186 | **Es necesario estar dentro del directorio donde está el archivo program.org para programarlo**. 187 | 188 | org-bash-blog -p 189 | 190 | Si la carpeta contenía archivos html de la previsualización anterior, serán eliminados. 191 | 192 | Para ver los Artículos que tenemos programados, utilizaremos la opción **\-h** de ayuda. En la parte inferior de la ayuda aparecen todos los archivos programados con su título, fecha y hora. 193 | 194 | org-bash-blog -h 195 | 196 | Cuando llegue la fecha y hora, el Artículo programado, org-bash-blog pasará el artículo programado del archivo **program.org** al archivo **blog.org**. 197 | 198 | **Cada vez que modifiques el archivo program.org o modifiques una fecha de publicación, tienes que ejecutar** `org-bash-blog -p` **para que org-bash-blog los ordene por fecha para la publicación.** 199 | 200 | org-bash-blog -p 201 | 202 | Calendario de Publicaciones 203 | --------------------------- 204 | 205 | Si deseas ver la programación de los artículos programados mediante un calendario, ejecuta: 206 | 207 | org-bash-blog -cal 208 | 209 | Org-Bash-Blog abrirá calcurse y verás los días programados en el calendario con el título seguido de # org-bash-blog 210 | 211 | Publicación manual o modificación de Artículo 212 | --------------------------------------------- 213 | 214 | Si queremos modificar o eliminar algún artículo publicado, lo haremos en el archivo **blog.org**. 215 | 216 | Para que el cambio ejecutar este cambio 217 | 218 | org-bash-blog blog.org 219 | 220 | **Org-bash-blog** creará todas las páginas .html, index.html, list.html, tag.html y el archivo feed.xml 221 | 222 | Publicación en GitHub, GitLab,… 223 | ------------------------------- 224 | 225 | Si tu blog está en repositorio tipo git, puedes hacer un git push desde cualquier directorio con: 226 | 227 | org-bash-blog -g 228 | 229 | Editar draft 230 | ------------ 231 | 232 | Abre el archivo **draft.org** con emacs en modo gráfico. 233 | 234 | org-bash-blog draft 235 | 236 | Abre el archivo **draft.org** con emacs en modo terminal 237 | 238 | org-bash-blog draftt 239 | 240 | Editar program 241 | -------------- 242 | 243 | Abre el archivo **program.org** con emacs en modo gráfico. 244 | 245 | org-bash-blog program 246 | 247 | Abre el archivo **program.org** con emacs en modo terminal 248 | 249 | org-bash-blog programt 250 | 251 | Editar blog 252 | ----------- 253 | 254 | Abre el archivo **blog.org** con emacs en modo gráfico. 255 | 256 | org-bash-blog blog 257 | 258 | Abre el archivo **blog.org** con emacs en modo terminal 259 | 260 | org-bash-blog blogt 261 | 262 | Resumen del proceso, creación, programación, publicación de un Artículo 263 | ----------------------------------------------------------------------- 264 | 265 | draft -> program -> blog 266 | 267 | Crea un nuevo artículo en draft 268 | 269 | org-bash-blog -n 270 | 271 | Si lo quieres importar desde un archivo markdown 272 | 273 | org-bash-blog -nim archivo.md 274 | 275 | Para enviar artículos de draft.org a program.org, cambiamos del estado **TODO** A **PROGRAM** y ejecutamos el comando: 276 | 277 | org-bash-blog -d 278 | 279 | Para previsualizarlo y que org-bash-blog añada la descripción del artículo para el feed: 280 | 281 | org-bash-blog -w programa.org 282 | 283 | Programa la publicación 284 | 285 | org-bash-blog -p 286 | 287 | NOVEDADES 288 | 289 | * Programar los días y horas de las publicaciones 290 | * Menú para generar el post 291 | * Muestra de forma gráfica en un calendario los dias de publicación 292 | * Añade buscador de artículos 293 | * Auto rellena el nombre de la página html, la descripción del post, ... 294 | * Descarga imágenes para incrustarlas en el artículos de imágenes en la web 295 | * Muestra el número de palabras y tiempo de lectura 296 | * Genera páginas relacionadas por categorías 297 | * Instalación de paquetes necesarios y autoconfiguración 298 | * Importanción desde archivos markdown 299 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal 2 | google_analytics: UA-131560140-1 3 | -------------------------------------------------------------------------------- /emacs.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> 3 | <channel> 4 | <title>uGeek - Blog de Tecnología 5 | https://ugeek.github.io/blog 6 | Blog de Tecnología, Android, GNU Linux, Servidores, y mucho más. Blog vinculado al Blog del Podcast de uGeek 7 | 8 | https://ugeek.github.io/ugeek.png 9 | uGeek - Blog de Tecnología 10 | https://ugeek.github.io/blog 11 | 12 | es 13 | 14 | org-bash-blog static site generator (https://github.com/ugeek/org-bash-blog) 15 | 16 | 17 | -------------------------------------------------------------------------------- /feed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | uGeek - Blog de Tecnología 5 | https://ugeek.github.io/blog 6 | Blog de Tecnología, Android, GNU Linux, Servidores, y mucho más. Blog vinculado al Blog del Podcast de uGeek 7 | 8 | https://ugeek.github.io/ugeek.png 9 | uGeek - Blog de Tecnología 10 | https://ugeek.github.io/blog 11 | 12 | es 13 | 14 | org-bash-blog static site generator (https://github.com/ugeek/org-bash-blog) 15 | 16 | Eliminar líneas en Blanco con sed 17 | https://ugeek.github.io/blog/post/2018-12-27-eliminar-lineas-en-blanco.html 18 | 19 | <img src="https://ugeek.github.io/blog/images/images-blog.png" alt="Eliminar líneas en Blanco con sed"> 20 | <br><p>Como podemos eliminar líneas en Blanco... 21 | <p>Sigue leyendo el post completo de <a href=https://ugeek.github.io/blog/post/2018-12-27-eliminar-lineas-en-blanco.html>Eliminar líneas en Blanco con sed</a> 22 | 23 | </a></p><p> 24 | 25 | <a href=https://ugeek.github.io/blog>Visita uGeek - Blog de Tecnología</a> 26 | 27 | </a></p><p> 28 | 29 | <a href=https://ugeek.github.io>Visita uGeek Podcast</a> 30 | 31 | 32 | </a></p><p> 33 | 34 | <a href=http://feeds.feedburner.com/ugeekblog>Suscribete al Blog de uGeek</a> 35 | 36 | </a></p><p> 37 | 38 | <a href=http://feeds.feedburner.com/ugeek>Suscribete al Podcast de uGeek</a> 39 | 40 | 41 | Thu, 27 Dec 2018 +0100 42 | unix 43 | bash 44 | unix 45 | terminal 46 | https://ugeek.github.io/blog/post/2018-12-27-eliminar-lineas-en-blanco.html 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /icon/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/icon/github.png -------------------------------------------------------------------------------- /icon/podcast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/icon/podcast.png -------------------------------------------------------------------------------- /icon/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/icon/rss.png -------------------------------------------------------------------------------- /icon/spotify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/icon/spotify.png -------------------------------------------------------------------------------- /icon/telegram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/icon/telegram.png -------------------------------------------------------------------------------- /icon/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/icon/twitter.png -------------------------------------------------------------------------------- /icon/ugeek-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/icon/ugeek-256x256.png -------------------------------------------------------------------------------- /icon/ugeek.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/icon/ugeek.jpg -------------------------------------------------------------------------------- /icon/ugeek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/icon/ugeek.png -------------------------------------------------------------------------------- /images-blog/sed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/images-blog/sed.png -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | 2 | ## Install Org-bash-blog 3 | 4 | There are two ways to use: 5 | 6 | ### Install on your server 7 | 8 | ``` 9 | sudo wget -O /usr/bin/org-bash-blog https://raw.githubusercontent.com/uGeek/org-bash-blog/master/org-bash-blog 10 | ``` 11 | 12 | ``` 13 | sudo chmod +x /usr/bin/org-bash-blog 14 | ``` 15 | 16 | Go to the root folder of the website and copy the config file: 17 | 18 | ``` 19 | wget https://raw.githubusercontent.com/uGeek/org-bash-blog/master/config 20 | ``` 21 | 22 | Now, change the default values and put yours 23 | 24 | 25 | ## Clone the repository: 26 | 27 | ``` 28 | git clone git@github.com:uGeek/org-bash-blog.git 29 | ``` 30 | 31 | ## Install Pandoc 32 | 33 | Ubuntu, Debian, Raspbian... 34 | ``` 35 | sudo apt install pandoc 36 | ``` 37 | 38 | ## Help 39 | 40 | ``` 41 | org-bash-blog -h 42 | ``` 43 | 44 | 45 | 46 | 47 | Angel 48 | 49 | https://ugeek.github.io 50 | 51 | ugeekpodcast@gmail.com 52 | -------------------------------------------------------------------------------- /js/tipuesearch.min.js: -------------------------------------------------------------------------------- 1 | (function($){$.fn.tipuesearch=function(options){var set=$.extend({'show':7,'newWindow':false,'showURL':true,'showTitleCount':true,'minimumLength':3,'descriptiveWords':25,'highlightTerms':true,'highlightEveryTerm':false,'mode':'static','liveDescription':'*','liveContent':'*','contentLocation':'tipuesearch/tipuesearch_content.json','debug':false},options);return this.each(function(){var tipuesearch_in={pages:[]};$.ajaxSetup({async:false});var tipuesearch_t_c=0;if(set.mode=='live') 2 | {for(var i=0;i');var t_2=html.toLowerCase().indexOf('',t_1+7);if(t_1!=-1&&t_2!=-1) 5 | {var tit=html.slice(t_1+7,t_2);} 6 | else 7 | {var tit=tipuesearch_string_1;} 8 | tipuesearch_in.pages.push({"title":tit,"text":desc,"tags":cont,"url":tipuesearch_pages[i]});});}} 9 | if(set.mode=='json') 10 | {$.getJSON(set.contentLocation).done(function(json) 11 | {tipuesearch_in=$.extend({},json);});} 12 | if(set.mode=='static') 13 | {tipuesearch_in=$.extend({},tipuesearch);} 14 | var tipue_search_w='';if(set.newWindow) 15 | {tipue_search_w=' target="_blank"';} 16 | function getURLP(name) 17 | {return decodeURIComponent((new RegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g,'%20'))||null;} 18 | if(getURLP('q')) 19 | {$('#tipue_search_input').val(getURLP('q'));getTipueSearch(0,true);} 20 | $(this).keyup(function(event) 21 | {if(event.keyCode=='13') 22 | {getTipueSearch(0,true);}});function getTipueSearch(start,replace) 23 | {$('#tipue_search_content').hide();$('#tipue_search_content').html('
');$('#tipue_search_content').show();var out='';var results='';var show_replace=false;var show_stop=false;var standard=true;var c=0;found=[];var d=$('#tipue_search_input').val().toLowerCase();d=$.trim(d);if((d.match("^\"")&&d.match("\"$"))||(d.match("^'")&&d.match("'$"))) 24 | {standard=false;} 25 | if(standard) 26 | {var d_w=d.split(' ');d='';for(var i=0;i=set.minimumLength) 36 | {if(standard) 37 | {if(replace) 38 | {var d_r=d;for(var i=0;i$1");} 59 | if(tipuesearch_in.pages[i].tags.search(pat)!=-1) 60 | {var m_c=tipuesearch_in.pages[i].tags.match(pat).length;score+=(10*m_c);} 61 | if(tipuesearch_in.pages[i].url.search(pat)!=-1) 62 | {score+=20;} 63 | if(score!=0) 64 | {for(var e=0;e$1");} 84 | if(tipuesearch_in.pages[i].tags.search(pat)!=-1) 85 | {var m_c=tipuesearch_in.pages[i].tags.match(pat).length;score+=(10*m_c);} 86 | if(tipuesearch_in.pages[i].url.search(pat)!=-1) 87 | {score+=20;} 88 | if(score!=0) 89 | {for(var e=0;e'+d_r+'';} 99 | if(c==1) 100 | {out+='
'+tipuesearch_string_4+'
';} 101 | else 102 | {c_c=c.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");out+='
'+c_c+' '+tipuesearch_string_5+'
';} 103 | found.sort(function(a,b){return b.score-a.score});var l_o=0;for(var i=0;i=start&&l_o'+found[i].title+'';if(set.debug) 106 | {out+='
Score: '+found[i].score+'
';} 107 | if(set.showURL) 108 | {var s_u=found[i].url.toLowerCase();if(s_u.indexOf('http://')==0) 109 | {s_u=s_u.slice(7);} 110 | out+='';} 111 | if(found[i].desc) 112 | {var t=found[i].desc;var t_d='';var t_w=t.split(' ');if(t_w.length';}} 120 | l_o++;} 121 | if(c>set.show) 122 | {var pages=Math.ceil(c / set.show);var page=(start / set.show);out+='
    ';if(start>0) 123 | {out+='
  • '+tipuesearch_string_6+'
  • ';} 124 | if(page<=2) 125 | {var p_b=pages;if(pages>3) 126 | {p_b=3;} 127 | for(var f=0;f';} 130 | else 131 | {out+='
  • '+(f+1)+'
  • ';}}} 132 | else 133 | {var p_b=page+2;if(p_b>pages) 134 | {p_b=pages;} 135 | for(var f=page-1;f';} 138 | else 139 | {out+='
  • '+(f+1)+'
  • ';}}} 140 | if(page+1!=pages) 141 | {out+='
  • '+tipuesearch_string_7+'
  • ';} 142 | out+='
';}} 143 | else 144 | {out+='
'+tipuesearch_string_8+'
';}} 145 | else 146 | {if(show_stop) 147 | {out+='
'+tipuesearch_string_8+'. '+tipuesearch_string_9+'
';} 148 | else 149 | {out+='
'+tipuesearch_string_10+'
';if(set.minimumLength==1) 150 | {out+='
'+tipuesearch_string_11+'
';} 151 | else 152 | {out+='
'+tipuesearch_string_12+' '+set.minimumLength+' '+tipuesearch_string_13+'
';}}} 153 | $('#tipue_search_content').hide();$('#tipue_search_content').html(out);$('#tipue_search_content').slideDown(200);$('#tipue_search_replaced').click(function() 154 | {getTipueSearch(0,false);});$('.tipue_search_foot_box').click(function() 155 | {var id_v=$(this).attr('id');var id_a=id_v.split('_');getTipueSearch(parseInt(id_a[0]),id_a[1]);});}});};})(jQuery); 156 | -------------------------------------------------------------------------------- /js/tipuesearch_set.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Tipue Search 5.0 4 | Copyright (c) 2015 Tipue 5 | Tipue Search is released under the MIT License 6 | http://www.tipue.com/search 7 | */ 8 | 9 | 10 | /* 11 | Stop words 12 | Stop words list from http://www.ranks.nl/stopwords 13 | */ 14 | 15 | var tipuesearch_stop_words = ["!", "@", "#", "$", "%", "^", "a", "about", "above", "after", "again", "against", "all", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "between", "both", "but", "by", "can't", "cannot", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "don't", "down", "during", "each", "few", "for", "from", "further", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "he'd", "he'll", "he's", "her", "here", "here's", "hers", "herself", "him", "himself", "his", "how", "how's", "i", "i'd", "i'll", "i'm", "i've", "if", "in", "into", "is", "isn't", "it", "it's", "its", "itself", "let's", "me", "more", "most", "mustn't", "my", "myself", "no", "nor", "not", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "ours", "ourselves", "out", "over", "own", "same", "shan't", "she", "she'd", "she'll", "she's", "should", "shouldn't", "so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "to", "too", "under", "until", "up", "very", "was", "wasn't", "we", "we'd", "we'll", "we're", "we've", "were", "weren't", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "who's", "whom", "why", "why's", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "you're", "you've", "your", "yours", "yourself", "yourselves"]; 16 | 17 | 18 | // Word replace 19 | 20 | var tipuesearch_replace = {'words': [ 21 | {'word': 'tipua', 'replace_with': 'tipue'}, 22 | {'word': 'javscript', 'replace_with': 'javascript'}, 23 | {'word': 'jqeury', 'replace_with': 'jquery'} 24 | ]}; 25 | 26 | 27 | // Weighting 28 | 29 | var tipuesearch_weight = {'weight': [ 30 | {'url': 'http://www.tipue.com', 'score': 200}, 31 | {'url': 'http://www.tipue.com/search', 'score': 100}, 32 | {'url': 'http://www.tipue.com/about', 'score': 100} 33 | ]}; 34 | 35 | 36 | // Stemming 37 | 38 | var tipuesearch_stem = {'words': [ 39 | {'word': 'e-mail', 'stem': 'email'}, 40 | {'word': 'javascript', 'stem': 'jquery'}, 41 | {'word': 'javascript', 'stem': 'js'} 42 | ]}; 43 | 44 | 45 | // Internal strings 46 | 47 | var tipuesearch_string_1 = 'No title'; 48 | var tipuesearch_string_2 = 'Showing results for'; 49 | var tipuesearch_string_3 = 'Search instead for'; 50 | var tipuesearch_string_4 = '1 resultado'; 51 | var tipuesearch_string_5 = 'resultados'; 52 | var tipuesearch_string_6 = 'Anterior'; 53 | var tipuesearch_string_7 = 'Siguiente'; 54 | var tipuesearch_string_8 = 'No he encontrado nada de lo que buscas'; 55 | var tipuesearch_string_9 = 'Common words are largely ignored'; 56 | var tipuesearch_string_10 = 'Busqueda demasiado corta'; 57 | var tipuesearch_string_11 = 'Should be one character or more'; 58 | var tipuesearch_string_12 = 'Should be'; 59 | var tipuesearch_string_13 = 'characters or more'; 60 | -------------------------------------------------------------------------------- /list.html: -------------------------------------------------------------------------------- 1 | 2 | Artículos. uGeek - Blog de Tecnología 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 |








47 | 48 |
podcast      GitHub      Twitter   Telegram
49 | 50 |

1 Artículos Publicados

51 | 54 |


Powered by org-bash-blog

Writing in orgmode whith emacs

Licencia de Creative Commons
Este obra está bajo una licencia de Creative Commons Reconocimiento-NoComercial-CompartirIgual 4.0 Internacional.




55 | -------------------------------------------------------------------------------- /org-bash-blog: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # 5 | # Copyright (C) 2019 Angel. uGeek 6 | # ugeekpodcast@gmail.com 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | # 21 | # 22 | # 23 | VERSION="v5.9.5 05/01/21" 24 | # 25 | source config 26 | # 27 | # 28 | # 29 | TEMP_FILE="$PATH_BLOG.temp" 30 | if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "" ] || [ "$1" = "h" ] 31 | then 32 | echo " 33 | 34 | Modo de empleo: org-bash-blog [ARCHIVO ORG-MODE] 35 | 36 | Comando Significado 37 | org-bash-blog -n Nuevo post en draft.org 38 | org-bash-blog -nim Nuevo post importado de markdown a draft.org 39 | org-bash-blog -d Pasar todos los Artículos en estado PROGRAM, a program.org 40 | org-bash-blog -w Previsualizar Post programados 41 | org-bash-blog -p Programar Post por fecha y hora, de program.org 42 | org-bash-blog -ii Descargar Imagen desde internet o un servidor 43 | org-bash-blog -cal Previsualizar Post programados en calcurse 44 | 45 | org-bash-blog blog Abrir blog.org con emacs 46 | org-bash-blog draft Abrir draft.org con emacs 47 | org-bash-blog program Abrir program.org con emacs 48 | org-bash-blog blogt Abrir blog.org con emacs versión terminal 49 | org-bash-blog draftt Abrir draft.org con emacs versión terminal 50 | org-bash-blog programt Abrir program.org con emacs versión terminal 51 | 52 | org-bash-blog -g Publicar en git 53 | 54 | org-bash-blog -i Instalar org-bash-blog en tu pc. Situate donde esta el script y ejecuta: ./org-bash-blog -i 55 | org-bash-blog -b Construir carpetas 56 | org-bash-blog -f Crear Nuevo Org-Mode 57 | org-bash-blog -ia Añadir a tu sistema los alias blog y program 58 | org-bash-blog -h Ayuda y ver Posts programados 59 | 60 | 61 | 62 | Ejemplos: 63 | 64 | - Asistente para crear nuevo artículo en draft.org: 65 | org-bash-blog -n 66 | 67 | - Asistente para crear artículo, importado de un archivo markdown: 68 | org-bash-blog -nim archivo.md 69 | 70 | - Importar de draft.org a program.org, todos los artículos en estado PROGRAM: 71 | org-bash-blog -d 72 | 73 | - Previsualizar e importar del archivo orgmode, las línas de descripción del artículo 74 | para el feed. 75 | org-bash-blog -w program.org 76 | 77 | - Programar todos los articulos de program.org 78 | org-bash-blog -p 79 | 80 | Otros: 81 | Crea un nuevo archivo orgmode para el blog 82 | org-bash-blog -f [ARCHIVO ORG-MODE] 83 | 84 | 85 | Post Programados: 86 | 87 | $(crontab -l | grep "org-bash-blog" | grep "^# " | sed -e 's/^.//' | cut -d '#' -f1 | sort -k2 ) 88 | 89 | 90 | org-bash-blog 91 | "$VERSION" 92 | " 93 | exit 94 | fi 95 | if [ "$1" = "-ii" ] 96 | then 97 | echo "Nombre de la imágen" 98 | read NOMBRE 99 | echo "Escribe la url" 100 | read URL 101 | wget -O $PATH_BLOG/images-blog/$NOMBRE $URL 102 | echo "#+HTML:
" >> $PATH_BLOG/program/draft.org 103 | echo "[[./images-blog/$NOMBRE]]" >> $PATH_BLOG/program/draft.org 104 | echo "#+HTML:
" >> $PATH_BLOG/program/draft.org 105 | exit 106 | fi 107 | if [ $1 = "-dt" ] 108 | then 109 | grep ":TITLE:" $2 | cut -d " " -f2- > $TEMP_FILE/title 110 | grep ":EXPORT_DATE:" $2 | cut -d " " -f2- > $TEMP_FILE/date 111 | paste -d, $TEMP_FILE/title $TEMP_FILE/date > $TEMP_FILE/moddate 112 | exit 113 | fi 114 | if [ $1 = "-d" ] 115 | then 116 | PROGRAM=$(grep -c "^* PROGRAM" $PATH_BLOG/program/draft.org) 117 | echo " 118 | Enviando $PROGRAM Artículos a program.org... 119 | " 120 | grep -n "^* " $PATH_BLOG/program/draft.org | cut -d ":" -f1 > $TEMP_FILE/firstlines 121 | while read LINEA; do 122 | echo "$LINEA - 1" | bc >> $TEMP_FILE/lastlines 123 | done < $TEMP_FILE/firstlines 124 | sed -i '1d' $TEMP_FILE/lastlines 125 | echo $(cat $PATH_BLOG/program/draft.org | wc -l) >> $TEMP_FILE/lastlines 126 | echo "" > $TEMP_FILE/draft.csv 127 | while read a && read b <&3; do 128 | echo "$a,$b" >> $TEMP_FILE/draft.csv 129 | done < $TEMP_FILE/firstlines 3< $TEMP_FILE/lastlines 130 | grep -n "^* PROGRAM" $PATH_BLOG/program/draft.org | cut -d ":" -f1 > $TEMP_FILE/draft2program 131 | while read LINEA; do 132 | FIRSTL=$(grep "$LINEA" $TEMP_FILE/draft.csv | cut -d, -f1) 133 | LASTL=$(grep "$LINEA" $TEMP_FILE/draft.csv | cut -d, -f2) 134 | 135 | sed -n ''$FIRSTL','$LASTL' p' $PATH_BLOG/program/draft.org >> $PATH_BLOG/program/program.org 136 | 137 | done < $TEMP_FILE/draft2program 138 | rm $TEMP_FILE/firstlines $TEMP_FILE/lastlines $TEMP_FILE/draft2program $TEMP_FILE/draft.csv $TEMP_FILE/programfirstlines > /dev/null 2>&1 139 | PROGRAM=$(grep -c "^* BLOG" $PATH_BLOG/program/draft.org) 140 | echo " 141 | Enviando $PROGRAM Artículos a blog.org... 142 | " 143 | grep -n "^* " $PATH_BLOG/program/draft.org | cut -d ":" -f1 > $TEMP_FILE/firstlines 144 | while read LINEA; do 145 | echo "$LINEA - 1" | bc >> $TEMP_FILE/lastlines 146 | done < $TEMP_FILE/firstlines 147 | sed -i '1d' $TEMP_FILE/lastlines 148 | echo $(cat $PATH_BLOG/program/draft.org | wc -l) >> $TEMP_FILE/lastlines 149 | echo "" > $TEMP_FILE/draft.csv 150 | while read a && read b <&3; do 151 | echo "$a,$b" >> $TEMP_FILE/draft.csv 152 | done < $TEMP_FILE/firstlines 3< $TEMP_FILE/lastlines 153 | grep -n "^* BLOG" $PATH_BLOG/program/draft.org | cut -d ":" -f1 > $TEMP_FILE/draft2program 154 | while read LINEA; do 155 | FIRSTL=$(grep "$LINEA" $TEMP_FILE/draft.csv | cut -d, -f1) 156 | LASTL=$(grep "$LINEA" $TEMP_FILE/draft.csv | cut -d, -f2) 157 | 158 | sed -n ''$FIRSTL','$LASTL' p' $PATH_BLOG/program/draft.org >> $PATH_BLOG/blog.org 159 | 160 | done < $TEMP_FILE/draft2program 161 | rm $TEMP_FILE/firstlines $TEMP_FILE/lastlines $TEMP_FILE/draft2program $TEMP_FILE/draft.csv $TEMP_FILE/programfirstlines > /dev/null 2>&1 162 | sed -i 's|^* PROGRAM|* DONE|g' $PATH_BLOG/program/draft.org 163 | sed -i 's|^* BLOG|* DONE|g' $PATH_BLOG/program/draft.org 164 | sed -i 's|^* PROGRAM|* TODO|g' $PATH_BLOG/program/program.org 165 | sed -i 's|^* BLOG|* TODO|g' $PATH_BLOG/blog.org 166 | rm $TEMP_FILE/firstlines $TEMP_FILE/lastlines $TEMP_FILE/draft2program $TEMP_FILE/draft.csv $TEMP_FILE/programfirstlines > /dev/null 2>&1 167 | exit 168 | fi 169 | if [ $1 = "program" ] 170 | then 171 | emacs $PATH_BLOG/program/program.org 172 | exit 173 | fi 174 | if [ $1 = "draft" ] 175 | then 176 | emacs $PATH_BLOG/program/draft.org 177 | exit 178 | fi 179 | if [ $1 = "blog" ] 180 | then 181 | emacs $PATH_BLOG/blog.org 182 | exit 183 | fi 184 | if [ $1 = "programt" ] 185 | then 186 | emacs -q -nw $PATH_BLOG/program/program.org 187 | exit 188 | fi 189 | if [ $1 = "draftt" ] 190 | then 191 | emacs -q -nw $PATH_BLOG/program/draft.org 192 | exit 193 | fi 194 | if [ $1 = "blogt" ] 195 | then 196 | emacs -q -nw $PATH_BLOG/blog.org 197 | exit 198 | fi 199 | if [ $1 = "-g" ] 200 | then 201 | git --git-dir=$PATH_BLOG/.git --work-tree=$PATH_BLOG add . 202 | git --git-dir=$PATH_BLOG/.git --work-tree=$PATH_BLOG commit -m "update" 203 | git --git-dir=$PATH_BLOG/.git --work-tree=$PATH_BLOG push 204 | exit 205 | fi 206 | if [ $1 = "-i" ] 207 | then 208 | clear 209 | sed -i "s|/home/angel/blog/|$PWD/|g" config 210 | sed -i "s|source config|source $PWD/config|g" org-bash-blog 211 | cp org-bash-blog /usr/bin/ 212 | chmod +x /usr/bin/org-bash-blog 213 | echo "Instalado Org-Bash-Blog" 214 | echo "Instalando complementos para derivadas de Debian" 215 | echo "" 216 | sudo apt update 217 | sudo apt install bash pandoc xml2 wget bc calcurse whiptail 218 | echo " " 219 | echo "Si no utilizas una derivada de Debian, instala los paquetes" 220 | echo " bash pandoc xml2 wget bc calcurse whiptail" 221 | echo "" 222 | exit 223 | fi 224 | if [ $1 = "-ia" ] 225 | then 226 | echo "Vamos a enviar alias para acceder a tus carpetas de un modo rápido" 227 | echo "¿Cual es tu archivo de configuración?" 228 | echo "¿ .bashrc, .zshrc,... ?" 229 | read CONFIG_FILE 230 | echo "alias blog='$PATH_BLOG'" >> $HOME/$CONFIG_FILE 231 | echo "alias program='"$PATH_BLOG"program'" >> $HOME/$CONFIG_FILE 232 | clear 233 | echo "Reinicia tu terminal para que funcionen los nuevos alias." 234 | echo "blog: Te lleva directamente a la raíz del directorio del blog" 235 | echo "program: Te lleva directamente al directorio program" 236 | exit 237 | fi 238 | if [ $1 = "-cal" ] 239 | then 240 | calcurse 241 | exit 242 | fi 243 | if [ $1 = "-w" ] 244 | then 245 | if [ -d ../program ]; 246 | then 247 | clear 248 | echo "Iniciando Previsualización del Post" 249 | else 250 | clear 251 | echo "" 252 | echo "" 253 | echo "" 254 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 255 | echo "" 256 | echo " NO ESTAS EN EL DIRECTORIO PROGRAM!! " 257 | echo "" 258 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 259 | echo "" 260 | echo "" 261 | echo "Para situarte en el directorio program, escribe:" 262 | echo " org-bash-blog -rp" 263 | exit 1 264 | fi 265 | echo "Previsualizando... " 266 | PROGRAMS_ORG=$2 267 | TODO=$(grep -c "^* TODO" $PROGRAMS_ORG) 268 | echo " 269 | Programando $TODO Artículos... 270 | " 271 | grep ":TITLE:" $PROGRAMS_ORG | cut -d " " -f2- | tail -$TODO > $TEMP_FILE/title 272 | grep ":EXPORT_DATE:" $PROGRAMS_ORG | cut -d " " -f2- | tail -$TODO > $TEMP_FILE/date 273 | grep -n "^* TODO" $PROGRAMS_ORG | cut -d ":" -f1 > $TEMP_FILE/firstlines 274 | cat $PROGRAMS_ORG | wc -l >> $TEMP_FILE/firstlines 275 | while read LINEA; do 276 | echo "$LINEA - 1" | bc >> $TEMP_FILE/lastlines 277 | done < $TEMP_FILE/firstlines 278 | cat $TEMP_FILE/lastlines | sed '$d' > $TEMP_FILE/temp 279 | echo $(cat $PROGRAMS_ORG | wc -l) >> $TEMP_FILE/temp 280 | cat $TEMP_FILE/firstlines | sed '$d' > $TEMP_FILE/primeralinea 281 | cat $TEMP_FILE/temp | sed '1d' > $TEMP_FILE/ultimalinea 282 | paste -d, $TEMP_FILE/primeralinea $TEMP_FILE/ultimalinea $TEMP_FILE/date $TEMP_FILE/title > $TEMP_FILE/program.csv 283 | VOL=0 284 | while read LINEA; do 285 | NUM=$(echo "$VOL + 1" | bc ) 286 | VOL=$NUM 287 | LINEAP=$(echo $LINEA | cut -d, -f1) 288 | LINEAU=$(echo $LINEA | cut -d, -f2) 289 | DIA=$(echo $LINEA | cut -d, -f3) 290 | TITLEPROGRAM=$(echo $LINEA | cut -d, -f4- | sed -e 's/^[ \t]*//; s/[ \t]*$//; /^$/d') 291 | TITLE_FILE=$(echo $TITLEPROGRAM | sed -e 's/ /-/g' ) 292 | sed -n "$LINEAP,$LINEAU"p $PROGRAMS_ORG | sed 's|^* TODO|*|g' > $TITLE_FILE.org 293 | sed -n "$LINEAP,$LINEAU"p $PROGRAMS_ORG | sed 's|^* TODO|*|g' > post.org 294 | sed -i "s|^* |* TODO |g" post.org 295 | DESCRIPTION=$(cat post.org | tail -n +11 | sed '/^ *$/d' | head -n +1 | cut -d " " -f1-30 | sed 's/[ \t]*$//') 296 | sed -i "s|:DESCRIPTION:.*|:DESCRIPTION:|g" post.org 297 | sed -i "s|:DESCRIPTION:|:DESCRIPTION: $DESCRIPTION|g" post.org 298 | cat post.org >> out.org 299 | echo $HEAD > $TITLE_FILE.html 300 | echo $HEAD_PAGE_POST >> $TITLE_FILE.html 301 | cat $TITLE_FILE.org | pandoc --from org --to html5 >> $TITLE_FILE.html 302 | sed -i 's|src="./images-blog/|src="../images-blog/|g' $TITLE_FILE.html 303 | sed -i 's||_|g' $TITLE_FILE.html 304 | sed -i 's|||g' $TITLE_FILE.html 305 | rm $TITLE_FILE.org 306 | echo $PIE_WEB >> $TITLE_FILE.html 307 | 308 | done < $TEMP_FILE/program.csv 309 | echo ' 310 | 311 | 312 | 313 | 314 | 315 | org-bash-blog. Index 316 | 317 | 318 |

Org-bash-blog v 5.2.4

319 |

Indice de todas las páginas creadas en tu repositorio

320 |
'$(find . -type f | grep .html | wc -l)' archivos .html
321 |
' > org-bash-blog.html 322 | find . -type f | grep .html | sed -r 's/(.*)/\\1\<\/a\>
/' | sort -r >> org-bash-blog.html 323 | $BROWSER org-bash-blog.html 324 | $BROWSER 325 | rm $TEMP_FILE/date $TEMP_FILE/firstlines $TEMP_FILE/lastlines $TEMP_FILE/primeralinea $TEMP_FILE/temp $TEMP_FILE/ultimalinea $TEMP_FILE/program.csv $TEMP_FILE/title 2>/dev/null 326 | cp out.org $PROGRAMS_ORG 327 | rm out.org post.org 328 | exit 329 | fi 330 | if [ $1 = "-b" ] 331 | then 332 | mkdir -p icon css org post images-blog categories .temp $HOME/.config/org-bash-blog/ program/ 333 | exit 334 | fi 335 | if [ $1 = "-p" ] 336 | then 337 | mkdir -p /home/$USER/.config/org-bash-blog/ /home/$USER/.calcurse/ 338 | ART="0" 339 | while read LINEA 340 | do 341 | INC=$(echo "$LINEA" | cut -d " " -f1,2) 342 | if [ "$INC" = "* TODO" ] 343 | then 344 | ART=$((1+$ART)) 345 | fi 346 | echo "$LINEA" >> $PATH_BLOG.temp/$ART.torg 347 | 348 | done < $PROGRAMS_ORG #program.org 349 | ls $PATH_BLOG.temp/*.torg -1 > $PATH_BLOG.temp/list.txt 350 | while read LINEA 351 | do 352 | DATE_POST=$(grep ":EXPORT_DATE:" $LINEA | cut -d " " -f2) 353 | mv $LINEA $DATE_POST-$LINEA 354 | done < $PATH_BLOG.temp/list.txt 355 | cat $(ls -r $PATH_BLOG.temp/*.torg) > program.org 356 | rm $PATH_BLOG.temp/list.txt $PATH_BLOG.temp/*.torg 357 | 358 | TODO=$(grep -c "^* TODO" $PROGRAMS_ORG) 359 | echo " 360 | Programando $TODO Artículos... 361 | " 362 | grep ":TITLE:" $PROGRAMS_ORG | cut -d " " -f2- | tail -$TODO > $TEMP_FILE/title 363 | grep ":EXPORT_DATE:" $PROGRAMS_ORG | cut -d " " -f2- | tail -$TODO > $TEMP_FILE/date 364 | grep -n "^* TODO" $PROGRAMS_ORG | cut -d ":" -f1 > $TEMP_FILE/firstlines 365 | cat $PROGRAMS_ORG | wc -l >> $TEMP_FILE/firstlines 366 | while read LINEA; do 367 | echo "$LINEA - 1" | bc >> $TEMP_FILE/lastlines 368 | done < $TEMP_FILE/firstlines 369 | cat $TEMP_FILE/lastlines | sed '$d' > $TEMP_FILE/temp 370 | echo $(cat $PROGRAMS_ORG | wc -l) >> $TEMP_FILE/temp 371 | cat $TEMP_FILE/firstlines | sed '$d' > $TEMP_FILE/primeralinea 372 | cat $TEMP_FILE/temp | sed '1d' > $TEMP_FILE/ultimalinea 373 | paste -d, $TEMP_FILE/primeralinea $TEMP_FILE/ultimalinea $TEMP_FILE/date $TEMP_FILE/title > $TEMP_FILE/program.csv 374 | echo "######### org-bash-blog #########" > $TEMP_FILE/cron_program 375 | echo " " >> $TEMP_FILE/cron_program 376 | rm "$PATH_SCRIPTS_PROGRAMS"org-bash-blog_program* 377 | VOL=0 378 | grep -v "## org-bash-blog" ~/.calcurse/apts > ~/.calcurse/apt 379 | mv ~/.calcurse/apt ~/.calcurse/apts 380 | while read LINEA; do 381 | NUM=$(echo "$VOL + 1" | bc ) 382 | VOL=$NUM 383 | LINEAP=$(echo $LINEA | cut -d, -f1) 384 | LINEAU=$(echo $LINEA | cut -d, -f2) 385 | DIA=$(echo $LINEA | cut -d, -f3) 386 | TITLEPROGRAM=$(echo $LINEA | cut -d, -f4- | sed -e 's/^[ \t]*//; s/[ \t]*$//; /^$/d') 387 | echo "$(date -d "$DIA" +'%m/%d/%Y @ %H:%M -> %m/%d/%Y @ %H:%M')|$TITLEPROGRAM ## org-bash-blog" >> ~/.calcurse/apts 388 | 389 | echo "# $(date -d "$DIA" +'%A %d de %B del %Y a las %H:%Mh') -> $TITLEPROGRAM ## org-bash-blog " >> $TEMP_FILE/cron_program 390 | date -d "$DIA" +'%M %H %d %m * bash '$PATH_SCRIPTS_PROGRAMS''org-bash-blog_program$NUM'.sh' >> $TEMP_FILE/cron_program 391 | echo " " >> $TEMP_FILE/cron_program 392 | echo "cat "$PROGRAMS_ORG" | sed -n '"$LINEAP","$LINEAU"p;"$LINEAU"q' >> "$BLOG_ORG" " > $PATH_SCRIPTS_PROGRAMS'org-bash-blog_program'$NUM.sh 393 | echo "sed -i '"$LINEAP","$LINEAU"d' "$PROGRAMS_ORG"" >> $PATH_SCRIPTS_PROGRAMS'org-bash-blog_program'$NUM.sh 394 | echo "cd $PATH_BLOG ; $ORG_BASH_BLOG $BLOG_ORG" >> $PATH_SCRIPTS_PROGRAMS'org-bash-blog_program'$NUM.sh 395 | echo $PUBLISH >> $PATH_SCRIPTS_PROGRAMS'org-bash-blog_program'$NUM.sh 396 | echo $SECOND_PUBLISH >> $PATH_SCRIPTS_PROGRAMS'org-bash-blog_program'$NUM.sh 397 | echo "rm $PATH_SCRIPTS_PROGRAMS'org-bash-blog_program'$NUM.sh" >> $PATH_SCRIPTS_PROGRAMS'org-bash-blog_program'$NUM.sh 398 | echo "Artículo: Nº$NUM 399 | Título: $TITLEPROGRAM 400 | Fecha: $(date -d "$DIA" +'%A %d de %B del %Y a las %H:%Mh') 401 | " 402 | done < $TEMP_FILE/program.csv 403 | echo "######### org-bash-blog #########" >> $TEMP_FILE/cron_program 404 | rm $TEMP_FILE/date $TEMP_FILE/firstlines $TEMP_FILE/lastlines $TEMP_FILE/primeralinea $TEMP_FILE/temp $TEMP_FILE/ultimalinea $TEMP_FILE/program.csv $TEMP_FILE/title 405 | crontab -l > $TEMP_FILE/my_cron 406 | sed -i '/org-bash-blog/d' $TEMP_FILE/my_cron 407 | sed -i '/^ *$/d' $TEMP_FILE/my_cron 408 | cat $TEMP_FILE/cron_program >> $TEMP_FILE/my_cron 409 | crontab $TEMP_FILE/my_cron 410 | rm $TEMP_FILE/my_cron $TEMP_FILE/cron_program 411 | rm *.html > /dev/null 2>&1 412 | exit 413 | fi 414 | if [ $1 = "-nim" ] 415 | then 416 | clear 417 | DRAFT_POST=$(whiptail --title "Org-Bash-Blog" \ 418 | --inputbox "Título del artículo" 7 40 \ 419 | 3>&1 1>&2 2>&3) 420 | status=$? 421 | if [ $status = 0 ] 422 | then 423 | echo "Nuevo Artículo" 424 | echo "--------------" 425 | 426 | echo " Título: $DRAFT_POST" 427 | else 428 | clear 429 | echo " Artículo cancelado" 430 | exit 431 | 432 | fi 433 | DRAFT_CAT=$(whiptail --title "Org-Bash-Blog" \ 434 | --inputbox "Categoria" 7 40 \ 435 | 3>&1 1>&2 2>&3) 436 | status=$? 437 | if [ $status = 0 ] 438 | then 439 | echo " Categoría: $DRAFT_CAT" 440 | else 441 | clear 442 | echo " Artículo cancelado" 443 | exit 444 | fi 445 | DRAFT_TAGS=$(whiptail --title "Org-Bash-Blog" \ 446 | --inputbox "Tags" 7 40 \ 447 | 3>&1 1>&2 2>&3) 448 | status=$? 449 | if [ $status = 0 ] 450 | then 451 | echo " Etiquetas: $DRAFT_TAGS" 452 | else 453 | clear 454 | echo " Artículo cancelado" 455 | exit 456 | fi 457 | DRAFT_IMAGE=$(whiptail --title "Org-Bash-Blog" \ 458 | --inputbox "Nombre de la imagen. Ejemplo: imagen.png" 7 40 \ 459 | 3>&1 1>&2 2>&3) 460 | status=$? 461 | if [ $status = 0 ] 462 | then 463 | echo " Imagen: $DRAFT_IMAGE" 464 | else 465 | clear 466 | exit 467 | fi 468 | URL_IMAGE=$(whiptail --title "Org-Bash-Blog" \ 469 | --inputbox "url de la imagen. Si la importas de un servidor" 7 40 \ 470 | 3>&1 1>&2 2>&3) 471 | status=$? 472 | if [ $status = 0 ] 473 | then 474 | wget -O $PATH_BLOG"images-blog"/$DRAFT_IMAGE $URL_IMAGE 2>/dev/null 475 | else 476 | clear 477 | echo " Artículo cancelado" 478 | exit 479 | fi 480 | DIA=$(date +"%Y-%m-%d %H:%M") 481 | echo '* TODO '$DRAFT_POST' 482 | :PROPERTIES: 483 | :TITLE: '$DRAFT_POST' 484 | :EXPORT_FILE_NAME: '$(echo $DRAFT_POST | sed 'y/:,.;áÁàÀãÃâÂéÉêÊíÍóÓõÕôÔúÚñÑçÇ/----aAaAaAaAeEeEiIoOoOoOuUnNcC/' | sed 's| |-|g' | sed 's|--|-|g' | tr '[:upper:]' '[:lower:]' | cut -d " " -f1,2,3,4,5,6,7,8,9,10)' 485 | :DESCRIPTION: 486 | :EXPORT_DATE: '$DIA' 487 | :CATEGORY: '$DRAFT_CAT' 488 | :TAG: '$DRAFT_TAGS' 489 | :IMAGE: ./images-blog/'$DRAFT_IMAGE' 490 | :END: 491 | [[./images-blog/'$DRAFT_IMAGE']] 492 | ' >> $DRAFT_ORG 493 | mv "$2" `echo $2 | tr ' ' '_'` 494 | pandoc -t org `echo $2 | tr ' ' '_'` --columns 1000000000 | sed -E "/^[[:space:]]+:/ d" >> $DRAFT_ORG 495 | $EMACS $DRAFT_ORG 496 | exit 497 | fi 498 | if [ $1 = "-n" ] 499 | then 500 | clear 501 | # 502 | DRAFT_POST=$(whiptail --title "Org-Bash-Blog" \ 503 | --inputbox "Título del artículo" 7 40 \ 504 | 3>&1 1>&2 2>&3) 505 | status=$? 506 | if [ $status = 0 ] 507 | then 508 | echo "Nuevo Artículo" 509 | echo "--------------" 510 | 511 | echo " Título: $DRAFT_POST" 512 | else 513 | clear 514 | echo " Artículo cancelado" 515 | exit 516 | 517 | fi 518 | DRAFT_CAT=$(whiptail --title "Org-Bash-Blog" \ 519 | --inputbox "Categoria" 7 40 \ 520 | 3>&1 1>&2 2>&3) 521 | status=$? 522 | if [ $status = 0 ] 523 | then 524 | echo " Categoría: $DRAFT_CAT" 525 | else 526 | clear 527 | echo " Artículo cancelado" 528 | exit 529 | fi 530 | DRAFT_TAGS=$(whiptail --title "Org-Bash-Blog" \ 531 | --inputbox "Tags" 7 40 \ 532 | 3>&1 1>&2 2>&3) 533 | status=$? 534 | if [ $status = 0 ] 535 | then 536 | echo " Etiquetas: $DRAFT_TAGS" 537 | else 538 | clear 539 | echo " Artículo cancelado" 540 | exit 541 | fi 542 | DRAFT_IMAGE=$(whiptail --title "Org-Bash-Blog" \ 543 | --inputbox "Nombre de la imagen. Ejemplo: imagen.png" 7 40 \ 544 | 3>&1 1>&2 2>&3) 545 | status=$? 546 | if [ $status = 0 ] 547 | then 548 | echo " Imagen: $DRAFT_IMAGE" 549 | else 550 | clear 551 | exit 552 | fi 553 | URL_IMAGE=$(whiptail --title "Org-Bash-Blog" \ 554 | --inputbox "url de la imagen. Si la importas de un servidor" 7 40 \ 555 | 3>&1 1>&2 2>&3) 556 | status=$? 557 | if [ $status = 0 ] 558 | then 559 | wget -O $PATH_BLOG"images-blog"/$DRAFT_IMAGE $URL_IMAGE 2>/dev/null 560 | else 561 | clear 562 | echo " Artículo cancelado" 563 | exit 564 | fi 565 | 566 | DIA=$(date +"%Y-%m-%d %H:%M") 567 | echo '* TODO '$DRAFT_POST' 568 | :PROPERTIES: 569 | :TITLE: '$DRAFT_POST' 570 | :EXPORT_FILE_NAME: '$(echo $DRAFT_POST | sed 'y/:,.;áÁàÀãÃâÂéÉêÊíÍóÓõÕôÔúÚñÑçÇ/----aAaAaAaAeEeEiIoOoOoOuUnNcC/' | sed 's| |-|g' | sed 's|--|-|g' | tr '[:upper:]' '[:lower:]' | cut -d " " -f1,2,3,4,5,6,7,8,9,10)' 571 | :DESCRIPTION: 572 | :EXPORT_DATE: '$DIA' 573 | :CATEGORY: '$DRAFT_CAT' 574 | :TAG: '$DRAFT_TAGS' 575 | :IMAGE: ./images-blog/'$DRAFT_IMAGE' 576 | :END: 577 | [[./images-blog/'$DRAFT_IMAGE']] 578 | ' >> $DRAFT_ORG 579 | $EMACS $DRAFT_ORG 580 | exit 581 | fi 582 | if [ $1 = "-f" ] 583 | then 584 | echo " 585 | " > $2 586 | exit 587 | fi 588 | if [ -f "$1" ] 589 | then 590 | TITLE=$(grep "#+TITLE:" $1 | cut -d " " -f2-) 591 | LINK=$(grep "#+LINK:" $1 | cut -d " " -f2-) 592 | DESCRIPTION=$(grep "#+DESCRIPTION:" $1 | cut -d " " -f2-) 593 | AUTHOR=$(grep "#+AUTHOR:" $1 | cut -d " " -f2-) 594 | grep ":TITLE:" $1 | cut -d " " -f2- | sed 's/,/|/g' | sed 's/^[ \t]*//; s/[ \t]*$//; /^$/d' > title 595 | grep ":EXPORT_FILE_NAME:" $1 | cut -d " " -f2- | awk '{print tolower($0)}' | sed 's/^[ \t]*//; s/[ \t]*$//; /^$/d' | sed 's/ /-/g' > link 596 | grep ":DESCRIPTION:" $1 | cut -d " " -f2- | sed 's/,/|/g'> description 597 | grep ":EXPORT_DATE:" $1 | cut -d " " -f2 | sed 's/^[ \t]*//; s/[ \t]*$//; /^$/d' > date- 598 | grep ":EXPORT_DATE:" $1 | cut -d " " -f3 | sed 's/^[ \t]*//; s/[ \t]*$//; /^$/d' > hour 599 | grep ":CATEGORY:" $1 | cut -d " " -f2- | sed 's/^[ \t]*//; s/[ \t]*$//; /^$/d' > category 600 | grep ":TAG:" $1 | cut -d " " -f2- | tr -d ' ' | sed "s|$|,,,,,,,,,|" | cut -d, -f -10 > tag 601 | grep ":IMAGE:" $1 | cut -d " " -f2- | tr -d ' ' > image 602 | cat date- | tr -d '-' > date 603 | paste -d, date title link description date- category tag hour image > postsID.csv 604 | cat postsID.csv | sort -t "," -k1,1r -k17,17r | cut -d, -f2- > posts.csv 605 | cat postsID.csv | sort | cut -d, -f2- > posts4feed.csv 606 | cat posts.csv | cut -d "," -f5 | sed '/^ *$/d' | uniq | sort > category.csv 607 | cat tag | cut -d "," -f1 > tags.csv 608 | cat tag | cut -d "," -f2 >> tags.csv 609 | cat tag | cut -d "," -f3 >> tags.csv 610 | cat tag | cut -d "," -f4 >> tags.csv 611 | cat tag | cut -d "," -f5 >> tags.csv 612 | cat tag | cut -d "," -f6 >> tags.csv 613 | cat tag | cut -d "," -f7 >> tags.csv 614 | cat tag | cut -d "," -f8 >> tags.csv 615 | cat tag | cut -d "," -f9 >> tags.csv 616 | cat tag | cut -d "," -f10 >> tags.csv 617 | cat tags.csv | sed '/^ *$/d' | sort | uniq > tag.csv 618 | echo " " >> $1 619 | NUM_POSTS=$(cat posts.csv | wc -l) 620 | TODO=$(grep -irq "^* TODO" $1) 621 | if [ $? -eq 0 ]; then 622 | clear 623 | echo ">>> org-bash-blog va a publicar el Post <<<" 624 | grep -n "^* TODO" $1 | cut -d ":" -f1 > TODO.txt 625 | LINES_BLOG=$(cat $1 | wc -l) 626 | cat $1 | wc -l >> TODO.txt 627 | echo "Hay $NUM_POSTS Artículos y $LINES_BLOG líneas en $1" 628 | echo "Se va a publicar $(grep -n "^* TODO" $1 | wc -l) Artículos" 629 | rm org/*.org 630 | ONE_LINE=$(cat TODO.txt | head -1) 631 | sed -i '1d' TODO.txt 632 | while read TWO_LINE; do 633 | LAST_LINE=$(($TWO_LINE - 1)) 634 | CATEGORY=$(cat $1 | sed -n "$ONE_LINE,$LAST_LINE"p | sed 's/* TODO/*/g' | grep ":CATEGORY:" | cut -d " " -f2) 635 | cat $1 | sed -n "$ONE_LINE,$LAST_LINE"p | sed 's/* TODO/*/g' >> org/$CATEGORY.org 636 | cat $1 | sed -n "$ONE_LINE,$LAST_LINE"p | sed 's/* TODO/*/g' > temp_post.org 637 | ONE_LINE=$(echo $TWO_LINE) 638 | PUB=$(expr $PUB + 1) 639 | echo "Publicando Artículo Nº $PUB $(grep ":TITLE:" temp_post.org | cut -d " " -f2-)" 640 | FILE_DATE=$(grep ":EXPORT_DATE:" temp_post.org | cut -d " " -f2) 641 | DATE_MOD=$(grep ":EXPORT_DATE:" temp_post.org | cut -d " " -f4) 642 | if [ -n "$DATE_MOD" ]; 643 | then 644 | echo " ***** Artículo Modificado *****" 645 | UPDATE=$(echo " y *actualizado* el $(date -d"$DATE_MOD" +'%A %d %B del %Y')") 646 | fi 647 | echo "#+HTML:
" >> temp_post.org 648 | echo "Publicado por $AUTHOR el $(date -d"$FILE_DATE" +'%A %d %B del %Y') $UPDATE" >> temp_post.org 649 | UPDATE=$(echo " ") 650 | echo "#+HTML:

" >> temp_post.org 651 | echo "También te puede interesar: 652 | " >> temp_post.org 653 | CATEGORY=$(grep ":CATEGORY:" temp_post.org | cut -d " " -f2) 654 | grep -i $CATEGORY posts.csv | sed '1d' > category_temp_post.csv 655 | cat category_temp_post.csv | head -n10 > cat_temp.csv 656 | cp cat_temp.csv category_temp_post.csv 657 | while read LINEA; do 658 | OTHERSTITLE=$(echo $LINEA | cut -d, -f1 | sed 's/|/,/g') 659 | OTHERSLINKS=$(echo $LINEA | cut -d, -f2) 660 | OTHERSDATE=$(echo $LINEA | cut -d, -f4) 661 | echo "- [[$LINK/post/$OTHERSDATE-$OTHERSLINKS.html][$OTHERSTITLE]]" >> temp_post.org 662 | done < category_temp_post.csv 663 | FILE_TITLE=$(grep ":TITLE:" temp_post.org | cut -d " " -f2- | sed 's/|/,/g') 664 | FILE_NAME=$(grep ":EXPORT_FILE_NAME:" temp_post.org | cut -d " " -f2- |awk '{print tolower($0)}' | sed 's/[ \t]*$//' | sed 's/ /-/g') 665 | FILE_DATE=$(grep ":EXPORT_DATE:" temp_post.org | cut -d " " -f2) 666 | FILE_IMAGE=$(grep ":IMAGE:" temp_post.org | cut -d " " -f2- | sed 's|./images-blog/||g' | sed 's/ //g' ) 667 | FILE=$(echo "$FILE_DATE-$FILE_NAME") 668 | FILE_DESCRIPTION=$(grep ":DESCRIPTION:" temp_post.org | cut -d " " -f2-) 669 | DESCRIPTION_P=$(echo $FILE_DESCRIPTION | sed 's/|/,/g') 670 | sed -i "1i #+DESCRIPTION: $DESCRIPTION_P" temp_post.org 671 | FILE_TAG=$(grep ":TAG:" temp_post.org | cut -d " " -f2-) 672 | TAG=$(echo $FILE_TAG | sed 's/|/,/g') 673 | sed -i "1i #+KEYWORDS: $TAG" temp_post.org 674 | echo "#+TITLE: $FILE_TITLE" > $FILE.org 675 | cat temp_post.org >> $FILE.org 676 | echo ' 677 | '$FILE_TITLE'. '$TITLE' 678 | 679 | 680 |
681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 |








720 | '$HEAD_PAGE_POST' 721 | 722 | 723 | 724 | 725 |
726 | 727 | 732 | 733 | ' > $FILE.html 734 | NUM_WORDS=$(cat $FILE.org | tail -n +11 | sed '/^ *$/d' | sed 's|^#.*||g' | sed 's|^\[.*||g' | sed 's|^** ||g' | sed '/^$/d' | wc -w) 735 | MIN=$(echo ""$NUM_WORDS"/110" | bc) 736 | sed -i 's|:END:|:END:\n\n#+HTML:
Tiempo estimado de lectura: '$MIN' minutos. '$NUM_WORDS' palabras. '$CATEGORY'
\n \n|g' $FILE.org 737 | PUBLISH_DATE=$(date -d "$FILE_DATE" +'%Y%m%d') 738 | TODAY_DATE=$(date --date='+3 year' +"%Y%m%d") 739 | if [ "$PUBLISH_DATE" -ge "$TODAY_DATE" ] ; then 740 | echo "#+HTML:

Este artículo se publicó hace más de 3 años. Puede tener contenido desactualizado.

" >> $FILE.org 741 | else 742 | echo " " > /dev/null 2>&1 743 | fi 744 | cat $FILE.org | pandoc --from org --to html5 >> $FILE.html 745 | sed -i 's||_|g' $FILE.html 746 | sed -i 's|||g' $FILE.html 747 | ORG=$(echo '


Powered by org-bash-blog

Writing in orgmode whith emacs

') 748 | echo $ORG $PIE_WEB >> $FILE.html 749 | rm $FILE.org 750 | sed -i 's|src="./images-blog/|src="../images-blog/|g' $FILE.html 751 | sed -i 's|__icon/|../icon/|g' $FILE.html 752 | sed -i 's|href="__css/|href="..css/|g' $FILE.html 753 | sed -i 's|href="index.html"|href="../index.html"|g' $FILE.html 754 | sed -i 's|href="list.html"|./href="../list.html"|g' $FILE.html 755 | sed -i 's|href="tag.html"|./href="../tag.html"|g' $FILE.html 756 | mv $FILE.html post/$FILE.html 757 | done < TODO.txt 758 | rm TODO.txt 759 | echo ' 760 | 761 | org-bash-blog. Index 762 | 763 | 764 | 765 |

Org-bash-blog v 5.0

766 |

Indice de todas las páginas creadas en tu repositorio

767 |
'$(find . -type f | grep .html | wc -l)' archivos .html
768 |
' > org-bash-blog.html 769 | find . -type f | grep .html | sed -r 's/(.*)/\\1\<\/a\>
/' | sort -r >> org-bash-blog.html 770 | $BROWSER org-bash-blog.html 771 | $BROWSER "post/$FILE.html" 772 | clear 773 | echo "Generando Feed" 774 | TODAY=$(date +'%A %d de %B del %Y') 775 | echo ' 776 | 777 | 778 | '$TITLE' 779 | '$LINK' 780 | '$DESCRIPTION' 781 | 782 | '$LOGO_FEED' 783 | '$TITLE' 784 | '$LINK' 785 | 786 | '$LANGUAGE_RSS' 787 | 788 | org-bash-blog static site generator (https://github.com/ugeek/org-bash-blog)'> feed.xml 789 | while read LINEA; do 790 | TITLE_F="$(echo $LINEA | cut -d, -f1 | sed 's/|/,/g')" 791 | LINK_P="$(echo $LINEA | cut -d, -f2)" 792 | DESC="$(echo $LINEA | cut -d, -f3 | sed 's/|/,/g')" 793 | CATEGORY_POST="$(echo $LINEA | cut -d, -f5)" 794 | CATEGORY_POST1="$(echo $LINEA | cut -d, -f6)" 795 | CATEGORY_POST2="$(echo $LINEA | cut -d, -f7)" 796 | CATEGORY_POST3="$(echo $LINEA | cut -d, -f8)" 797 | IMAGE_POST="$(echo $LINEA | cut -d, -f17 | sed "s|^./|$LINK/|")" 798 | DATE="$(echo $LINEA | cut -d, -f4)" 799 | HORA="$(echo $LINEA | cut -d, -f16)" 800 | DATEPU="$(LANG=en_us_88591 ; date -d"$DATE" +'%a, %d %b %Y')" 801 | DATEPUB=$(echo "$DATEPU $HORA +0100") 802 | LANG=locale 803 | GUID="http://ugeek.github.io" 804 | echo " " >> feed.xml 805 | echo " $TITLE_F" >> feed.xml 806 | echo " $LINK/post/$DATE-$LINK_P.html" >> feed.xml 807 | echo " " >> feed.xml 808 | echo '<img src="'$IMAGE_POST'" alt="'$TITLE_F'">' >> feed.xml 809 | echo "<br><p>$DESC... 810 | <p>Sigue leyendo el post completo de <a href="$LINK/post/$DATE-$LINK_P.html">$TITLE_F</a> 811 | </a></p><p> 812 | <a href="$LINK">Visita $TITLE</a> 813 | </a></p><p> 814 | <a href="https://ugeek.github.io">Visita uGeek Podcast</a> 815 | </a></p><p> 816 | <a href="http://feeds.feedburner.com/ugeekblog">Suscribete al Blog de uGeek</a> 817 | </a></p><p> 818 | <a href="http://feeds.feedburner.com/ugeek">Suscribete al Podcast de uGeek</a> 819 | " >> feed.xml 820 | echo " $DATEPUB" >> feed.xml 821 | echo ' '$CATEGORY_POST'' >> feed.xml 822 | echo ' '$CATEGORY_POST1'' >> feed.xml 823 | echo ' '$CATEGORY_POST2'' >> feed.xml 824 | echo ' '$CATEGORY_POST3'' >> feed.xml 825 | echo " $LINK/post/$DATE-$LINK_P.html 826 | " >> feed.xml 827 | done < posts.csv 828 | echo " 829 | " >> feed.xml 830 | echo "Generando Feed por Categoría" 831 | WORD="emacs" 832 | awk '/,emacs,/ { print }' posts.csv > emacs.csv 833 | echo ' 834 | 835 | 836 | '$TITLE' 837 | '$LINK' 838 | '$DESCRIPTION' 839 | 840 | '$LOGO_FEED' 841 | '$TITLE' 842 | '$LINK' 843 | 844 | '$LANGUAGE_RSS' 845 | 846 | org-bash-blog static site generator (https://github.com/ugeek/org-bash-blog)'> $WORD.xml 847 | while read LINEA; do 848 | TITLE_F="$(echo $LINEA | cut -d, -f1 | sed 's/|/,/g')" 849 | LINK_P="$(echo $LINEA | cut -d, -f2)" 850 | DESC="$(echo $LINEA | cut -d, -f3 | sed 's/|/,/g')" 851 | CATEGORY_POST="$(echo $LINEA | cut -d, -f5)" 852 | CATEGORY_POST1="$(echo $LINEA | cut -d, -f6)" 853 | CATEGORY_POST2="$(echo $LINEA | cut -d, -f7)" 854 | CATEGORY_POST3="$(echo $LINEA | cut -d, -f8)" 855 | IMAGE_POST="$(echo $LINEA | cut -d, -f17 | sed "s|^./|$LINK/|")" 856 | DATE="$(echo $LINEA | cut -d, -f4)" 857 | HORA="$(echo $LINEA | cut -d, -f16)" 858 | DATEPU="$(LANG=en_us_88591 ; date -d"$DATE" +'%a, %d %b %Y')" 859 | DATEPUB=$(echo "$DATEPU $HORA +0100") 860 | LANG=locale 861 | GUID="http://ugeek.github.io" 862 | echo " " >> $WORD.xml 863 | echo " $TITLE_F" >> $WORD.xml 864 | echo " $LINK/post/$DATE-$LINK_P.html" >> $WORD.xml 865 | echo " " >> $WORD.xml 866 | echo '<img src="'$IMAGE_POST'" alt="'$TITLE_F'">' >> $WORD.xml 867 | echo "<br><p>$DESC... 868 | <p>Sigue leyendo el post completo de <a href="$LINK/post/$DATE-$LINK_P.html">$TITLE_F</a> 869 | </a></p><p> 870 | <a href="$LINK">Visita $TITLE</a> 871 | </a></p><p> 872 | <a href="https://ugeek.github.io">Visita uGeek Podcast</a> 873 | </a></p><p> 874 | <a href="http://feeds.feedburner.com/ugeekblog">Suscribete al Blog de uGeek</a> 875 | </a></p><p> 876 | <a href="http://feeds.feedburner.com/ugeek">Suscribete al Podcast de uGeek</a> 877 | " >> $WORD.xml 878 | echo " $DATEPUB" >> $WORD.xml 879 | echo ' '$CATEGORY_POST'' >> $WORD.xml 880 | echo ' '$CATEGORY_POST1'' >> $WORD.xml 881 | echo ' '$CATEGORY_POST2'' >> $WORD.xml 882 | echo ' '$CATEGORY_POST3'' >> $WORD.xml 883 | echo " $LINK/post/$DATE-$LINK_P.html 884 | " >> $WORD.xml 885 | done < emacs.csv 886 | echo " 887 | " >> $WORD.xml 888 | echo "Generando Página Home" 889 | cat posts.csv | head -n5 > posts_home.csv 890 | echo " " >> index.org 891 | echo "$INDEX" >> index.org 892 | echo " " >> index.org 893 | echo "*** Últimos Artículos" >> index.org 894 | echo " " >> index.org 895 | while read LINEA; do 896 | TPOST=$(echo $LINEA | cut -d, -f1 | sed 's/|/,/g') 897 | UPOST=$(echo $LINEA | cut -d, -f2) 898 | DPOST=$(echo $LINEA | cut -d, -f4) 899 | echo "- [[$LINK/post/$DPOST-$UPOST.html][$TPOST]] " >> index.org 900 | done < posts_home.csv 901 | echo "$INDEX_NEXT" >> index.org 902 | echo ' 903 | '$TITLE' 904 | 905 | 906 |
907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 |








943 | '$HEAD_PAGE' 944 | 945 | 946 | 947 | 948 |
949 | 950 | 955 | 956 | '> index.html 957 | echo "Categorías" > $PATH_BLOG/categories.org 958 | ls -1 $PATH_BLOG/categories/ | cut -d"." -f1 | while read linea 959 | do 960 | echo "- [["$LINK"/categories/"$linea".html]["$linea"]]" 961 | done >> $PATH_BLOG/categories.org 962 | cat index.org | pandoc --from org --to html5 >> index.html 963 | echo $ORG $PIE_WEB >> index.html 964 | sed -i 's|__icon/|icon/|g' index.html 965 | sed -i 's|__css/|css/|g' index.html 966 | sed -i 's||_|g' index.html 967 | sed -i 's|||g' index.html 968 | rm index.org posts_home.csv 969 | echo "Generando Lista de Artículos" 970 | echo "* $NUM_POSTS Artículos Publicados" >> list.org 971 | while read LINEA; do 972 | TPOST=$(echo $LINEA | cut -d, -f1 | sed 's/|/,/g') 973 | UPOST=$(echo $LINEA | cut -d, -f2) 974 | DPOST=$(echo $LINEA | cut -d, -f4) 975 | echo "- /$DPOST/ - [[$LINK/post/$DPOST-$UPOST.html][$TPOST]] " >> list.org 976 | done < posts.csv 977 | echo ' 978 | Artículos. '$TITLE' 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 |








1018 | '$HEAD_PAGE' 1019 | 1020 | 1021 | 1022 | 1023 |
1024 | 1025 | 1030 | 1031 | ' > list.html 1032 | cat list.org | pandoc --from org --to html5 >> list.html 1033 | echo $ORG $PIE_WEB >> list.html 1034 | sed -i 's|__icon/|icon/|g' list.html 1035 | sed -i 's|__css/|css/|g' list.html 1036 | sed -i 's||_|g' list.html 1037 | sed -i 's|||g' list.html 1038 | rm list.org 1039 | echo "Generando Clasificación por Tags" 1040 | echo "** Etiquetas" >> tag.org 1041 | echo " " >> tag.org 1042 | while read TAG; do 1043 | grep -i "$TAG" posts.csv > temp_tag.csv 1044 | echo "#+HTML:

$TAG

" >> tag.org 1045 | NUM_TAGS=$(cat tag.csv | wc -l) 1046 | while read LINEA; do 1047 | TPOST=$(echo $LINEA | cut -d, -f1 | sed 's/|/,/g' ) 1048 | UPOST=$(echo $LINEA | cut -d, -f2) 1049 | DPOST=$(echo $LINEA | cut -d, -f4) 1050 | echo "- /$DPOST/ - [[$LINK/post/$DPOST-$UPOST.html][$TPOST]] " >> tag.org 1051 | done < temp_tag.csv 1052 | done < tag.csv 1053 | rm temp_tag.csv 1054 | echo ' 1055 | Etiquetas. '$TITLE' 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1087 | 1088 |








1089 | '$HEAD_PAGE' 1090 | ' > tag.html 1091 | cat tag.org | pandoc --from org --to html5 >> tag.html 1092 | echo $ORG $PIE_WEB >> tag.html 1093 | sed -i 's|__icon/|icon/|g' tag.html 1094 | sed -i 's|__css/|css/|g' tag.html 1095 | sed -i 's||_|g' tag.html 1096 | sed -i 's|||g' tag.html 1097 | rm tag.org category_temp_post.csv cat_temp.csv 1098 | echo "Generando Buscador" 1099 | echo "var tipuesearch = {"pages": [" > content.js 1100 | while read LINEA 1101 | do 1102 | TITLE_CONTENT=$(echo $LINEA | cut -d, -f1 | sed 's|\||,|g' | sed "s|'|,|g") 1103 | TEXT_CONTENT=$(echo $LINEA | cut -d, -f3 | sed 's|\||,|g' | sed "s|'|,|g") 1104 | TAGS_CONTENT=$(echo $LINEA | cut -d, -f5-10) 1105 | DATE_CONTENT=$(echo $LINEA | cut -d, -f4) 1106 | NAME_CONTENT=$(echo $LINEA | cut -d, -f2) 1107 | URL_CONTENT=$(echo "$DATE_CONTENT-$NAME_CONTENT.html") 1108 | echo "{" >> content.js 1109 | echo " '"title"': '"$TITLE_CONTENT"'," >> content.js 1110 | echo " '"text"': '"$TEXT_CONTENT"', " >> content.js 1111 | echo " '"tags"': '"$TAGS_CONTENT"', " >> content.js 1112 | echo " '"url"': '"$LINK/post/$URL_CONTENT"' " >> content.js 1113 | echo "}," >> content.js 1114 | done < posts.csv 1115 | echo "]};" >> content.js 1116 | echo "Generando Páginas de Categorias" 1117 | ls -1 org | cut -d"." -f1 > cat 1118 | while read CAT; do 1119 | echo ' 1120 | '$CAT' 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1155 | 1156 |








1157 | '$HEAD_PAGE_POST' 1158 | ' > categories/$CAT.html 1159 | echo "

$CAT

" >> categories/$CAT.html 1160 | grep "$CAT" postsID.csv > post_cat.csv 1161 | echo "
    " >> categories/$CAT.html 1162 | while read LINEA; do 1163 | TITLE_POST=$(echo $LINEA | cut -d, -f2 | sed 's|\||,|g') 1164 | DATE_POST=$(echo $LINEA | cut -d, -f5) 1165 | LINK_POST=$(echo $LINEA | cut -d, -f3) 1166 | echo "
  • $TITLE_POST
  • " >> categories/$CAT.html 1167 | done < post_cat.csv 1168 | echo "
" >> categories/$CAT.html 1169 | echo $ORG $PIE_WEB >> categories/$CAT.html 1170 | done < cat 1171 | rm *~ > /dev/null 2>&1 1172 | else 1173 | echo " " 1174 | fi 1175 | rm emacs.csv posts.csv 1176 | rm posts4feed.csv postsID.csv 1177 | rm tags.csv tag temp_post.org tag.csv cat post_cat.csv 1178 | rm hour image category.csv 1179 | rm title link description category date date- 1180 | sed -i '$d' $1 1181 | cp content.js content_blog.js 1182 | else 1183 | echo " " 1184 | exit 1185 | fi 1186 | -------------------------------------------------------------------------------- /org-bash-blog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | org-bash-blog. Index 4 | 5 | 6 | 7 |

Org-bash-blog v 5.0

8 |

Indice de todas las páginas creadas en tu repositorio

9 |
5 archivos .html
10 |
11 | ./tag.html
12 | ./post/2018-12-27-eliminar-lineas-en-blanco.html
13 | ./org-bash-blog.html
14 | ./list.html
15 | ./index.html
16 | -------------------------------------------------------------------------------- /org/unix.org: -------------------------------------------------------------------------------- 1 | * Eliminar líneas en Blanco con sed 2 | :PROPERTIES: 3 | :TITLE: Eliminar líneas en Blanco con sed 4 | :EXPORT_FILE_NAME: eliminar-lineas-en-blanco 5 | :DESCRIPTION: Como podemos eliminar líneas en Blanco 6 | :EXPORT_DATE: 2018-12-27 7 | :IMAGE: ./images/images-blog.png 8 | :CATEGORY: unix 9 | :TAG: bash,unix,terminal,sed 10 | :END: 11 | 12 | Para eliminar líneas en Blanco de un archivo de texto, podriamos utilizar *sed*. 13 | 14 | [[./images-blog/sed.png]] 15 | 16 | 17 | =cat archivo | sed '/^ *$/d' > nuevo_archivo= 18 | -------------------------------------------------------------------------------- /post/2018-12-27-eliminar-lineas-en-blanco.html: -------------------------------------------------------------------------------- 1 | 2 | Eliminar líneas en Blanco con sed. uGeek - Blog de Tecnología 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 |








53 | 54 |
podcast      GitHub      Twitter   Telegram
55 | 56 |

Eliminar líneas en Blanco con sed

57 |

Para eliminar líneas en Blanco de un archivo de texto, podriamos utilizar sed.

58 |

59 |

cat archivo | sed '/^ *$/d' > nuevo_archivo

60 |
61 |

Publicado por Angel el jueves 27 diciembre del 2018

62 |

63 |

También te puede interesar:

64 |


Powered by org-bash-blog

Writing in orgmode whith emacs

Licencia de Creative Commons
Este obra está bajo una licencia de Creative Commons Reconocimiento-NoComercial-CompartirIgual 4.0 Internacional.




65 | -------------------------------------------------------------------------------- /program/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/program/.gitkeep -------------------------------------------------------------------------------- /tag.html: -------------------------------------------------------------------------------- 1 | 2 | Etiquetas. uGeek - Blog de Tecnología 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 43 | 44 | 45 | 46 | 47 |








48 | 49 |
podcast      GitHub      Twitter   Telegram
50 | 51 |

Etiquetas

52 |

bash

53 | 56 |

sed

57 | 60 |

terminal

61 | 64 |

unix

65 | 68 |


Powered by org-bash-blog

Writing in orgmode whith emacs

Licencia de Creative Commons
Este obra está bajo una licencia de Creative Commons Reconocimiento-NoComercial-CompartirIgual 4.0 Internacional.




69 | -------------------------------------------------------------------------------- /ugeek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uGeek/org-bash-blog/93fa94d88eb3c3a87ad4aeab182891d5f5d6ee09/ugeek.png --------------------------------------------------------------------------------